Skip to content

Commit

Permalink
UIIN-2452: Change permissions to view/create holdings and items
Browse files Browse the repository at this point in the history
  • Loading branch information
OleksandrHladchenko1 committed Oct 24, 2023
1 parent 00589ea commit 99a92ca
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/Instance/HoldingsList/HoldingsListContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ const HoldingsListContainer = ({
const stripes = useStripes();
const { holdingsRecords: holdings, isLoading } = useInstanceHoldingsQuery(instance.id, { tenantId });

const canViewHoldings = stripes.hasPerm('ui-inventory.instance.view');
const canViewHoldings = stripes.hasPerm('ui-inventory.holdings.create');
const canCreateItem = stripes.hasPerm('ui-inventory.item.edit');
const canViewItems = stripes.hasPerm('ui-inventory.instance.view');
const canViewItems = stripes.hasPerm('ui-inventory.item.create');

if (isLoading) return <Loading size="large" />;

Expand Down
2 changes: 1 addition & 1 deletion src/Instance/InstanceDetails/InstanceDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const InstanceDetails = forwardRef(({
const tags = instance?.tags?.tagList;
const isUserInCentralTenant = checkIfUserInCentralTenant(stripes);

const canCreateHoldings = stripes.hasPerm('ui-inventory.holdings.edit');
const canCreateHoldings = stripes.hasPerm('ui-inventory.holdings.create');

const detailsLastMenu = useMemo(() => {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ const MemberTenantHoldings = ({
const { holdingsRecords, isLoading } = useInstanceHoldingsQuery(instance?.id, { tenantId: id });
const isUserInCentralTenant = checkIfUserInCentralTenant(stripes);

const canViewHoldings = hasMemberTenantPermission('ui-inventory.instance.view', id, userTenantPermissions);
const canViewHoldings = hasMemberTenantPermission('ui-inventory.holdings.create', id, userTenantPermissions);
const canCreateItem = hasMemberTenantPermission('ui-inventory.item.edit', id, userTenantPermissions);
const canCreateHoldings = hasMemberTenantPermission('ui-inventory.holdings.edit', id, userTenantPermissions);
const canViewItems = hasMemberTenantPermission('ui-inventory.instance.view', id, userTenantPermissions);
const canViewItems = hasMemberTenantPermission('ui-inventory.item.create', id, userTenantPermissions);

if (isEmpty(holdingsRecords)) return null;

Expand Down

0 comments on commit 99a92ca

Please sign in to comment.