Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cscfc4 emscr 617 revert bacl to mscr copy #236

Merged
merged 3 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions mscr-ui/public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"finish-editing": "Finish editing",
"invalidate-crosswalk": "Invalidate crosswalk",
"invalidate-schema": "Invalidate schema",
"mscr-copy": "Covert to MSCR Format",
"mscr-copy": "Make a MSCR Copy",
"publish-crosswalk": "Publish crosswalk",
"publish-schema": "Publish schema",
"revision": "Add new revision",
Expand Down Expand Up @@ -91,7 +91,7 @@
"crosswalk-create": "Create Crosswalk",
"crosswalk-register": "Register Crosswalk",
"crosswalk-revision": "Register revision",
"mscr-copy": "Convert to MSCR Format",
"mscr-copy": "MSCR Copy",
"schema-register": "Register Schema",
"schema-revision": "Register revision"
},
Expand All @@ -109,7 +109,7 @@
"crosswalk-mscr-copy": "Register MSCR copy of crosswalk",
"crosswalk-register": "Register existing crosswalk",
"crosswalk-revision": "Register revision of crosswalk",
"schema-mscr-copy": "Convert Schema to MSCR Format",
"schema-mscr-copy": "Make a MSCR copy",
"schema-register": "Register schema",
"schema-revision": "Register revision of schema"
},
Expand Down Expand Up @@ -278,7 +278,7 @@
"add-schema": "New schema added",
"add-schema-revision": "New schema version added",
"copy-crosswalk": "MSCR copy of crosswalk added",
"copy-schema": "Schema is converted to MSCR format",
"copy-schema": "MSCR copy of schema added",
"crosswalk-deleted": "Crosswalk was removed",
"crosswalk-deprecated": "Crosswalk deprecated",
"crosswalk-invalidated": "Crosswalk invalidated",
Expand Down
6 changes: 5 additions & 1 deletion mscr-ui/src/common/utils/has-permission.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ export default function HasPermission({ action, owner }: hasPermissionProps) {
}

export function checkPermission({ user, action, owner }: checkPermissionProps) {
if (action == 'EDIT_CONTENT' || action == 'CREATE_CONTENT' || action == 'MAKE_MSCR_COPY') {
//making MSCR Copy allowed for all
if (action == 'MAKE_MSCR_COPY') {
return true;
}
if (action == 'EDIT_CONTENT' || action == 'CREATE_CONTENT') {
if (owner?.includes(user.id)) {
//user is the owner, Check for personal Contents
return true;
Expand Down
2 changes: 1 addition & 1 deletion mscr-ui/src/modules/schema-view/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default function SchemaView({ schemaId }: { schemaId: string }) {
isEditContentActive &&
hasEditPermission &&
schemaData?.format === Format.Mscr;
const hasCopyPermission = HasPermission({ action: 'MAKE_MSCR_COPY', owner: schemaData?.owner});
const hasCopyPermission = HasPermission({ action: 'MAKE_MSCR_COPY'});
const router = useRouter(); // Force refresh the page
const isMscrCopyAvailable =
hasCopyPermission &&
Expand Down
Loading