Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
bures committed Jun 6, 2021
1 parent 9450e77 commit 91cb4ba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions client/src/shares/Share.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ export default class Share extends Component {
actions: data => {
const actions = [];
const autoGenerated = data[4];
const userId = data[3];

if (!autoGenerated) {
if (!autoGenerated && mailtrainConfig.user.id !== userId) {
const username = data[0];
const userId = data[3];

tableAddRestActionButton(
actions,
Expand Down
3 changes: 1 addition & 2 deletions server/models/shares.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ async function assign(context, entityTypeId, entityId, userId, role) {
await tx(entityType.permissionsTable).where({user: userId, entity: entityId}).del();
if (entityTypeId === 'namespace') {
await rebuildPermissionsTx(tx, {userId});
} else if (role) {
} else {
await rebuildPermissionsTx(tx, { entityTypeId, entityId, userId });
}
});
Expand Down Expand Up @@ -293,7 +293,6 @@ async function rebuildPermissionsTx(tx, restriction) {
}
}


// This reads direct shares from DB, joins each with the permissions from namespaces and stores the permissions into DB
for (const entityTypeId in restrictedEntityTypes) {
const entityType = restrictedEntityTypes[entityTypeId];
Expand Down

0 comments on commit 91cb4ba

Please sign in to comment.