some permission changes

the team permission in the global state was coming back empty, so am now retrieving the team permissions for file uploads in grain transacitons, also adjusted the bin visualizer to disable the slider and inventory button when they do not have write permissions so they cant even open the transaction window, this should help prevent a case in the possible future where we allow bin transactions to have uploadable files from having a bin shared to them and uploading a file but not being able to create the transaction that it would be linked to thus causing the file to be uploaded to digital ocean, but not connected in our backend to anything
This commit is contained in:
csawatzky 2026-02-13 12:51:26 -06:00
parent 1487c78466
commit 762a630659
4 changed files with 35 additions and 11 deletions

View file

@ -1434,6 +1434,7 @@ export default function BinVisualizer(props: Props) {
const controls = () => {
if (bin.settings.inventory?.empty === true) return null;
const canEdit = permissions ? permissions.includes(pond.Permission.PERMISSION_WRITE) : false;
return (
<Box
height={1}
@ -1447,12 +1448,13 @@ export default function BinVisualizer(props: Props) {
<React.Fragment>
<Box display="flex" height={isMobile ? 35 : 40} marginBottom={1}>
<IconButton
disabled={!canEdit}
onClick={() => {
setGrainUpdate(true);
}}
style={{
margin: "auto",
backgroundColor: "gold",
backgroundColor: canEdit ? "gold" : "grey",
color: "black",
height: "100%",
width: isMobile ? 35 : 40
@ -1468,6 +1470,7 @@ export default function BinVisualizer(props: Props) {
alignContent="flex-end">
{fillPercentage !== null && (
<Slider
disabled={!canEdit}
orientation="vertical"
value={fillPercentage}
classes={{
@ -1477,7 +1480,7 @@ export default function BinVisualizer(props: Props) {
// thumb: isMobile ? classes.mobileSliderThumb : classes.sliderThumb,
valueLabel: classes.sliderValLabel,
}}
style={{ height: "100%", color: sliderColour }}
style={{ height: "100%", color: canEdit ? sliderColour : "gray" }}
min={0}
max={100}
valueLabelDisplay="auto"