Skip to content

Commit

Permalink
feat(hub-common): add hub:[entity]:manage permission for all entities (
Browse files Browse the repository at this point in the history
…#1202)

affects: @esri/hub-common
  • Loading branch information
tomwayson authored Sep 7, 2023
1 parent 80866f5 commit 71191b7
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 18 deletions.
48 changes: 30 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions packages/common/src/content/_internal/ContentBusinessRules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const ContentPermissions = [
"hub:content:workspace:dashboard",
"hub:content:workspace:details",
"hub:content:workspace:settings",
"hub:content:manage",
] as const;

/**
Expand Down Expand Up @@ -71,4 +72,8 @@ export const ContentPermissionPolicies: IPermissionPolicy[] = [
dependencies: ["hub:content:edit"],
entityOwner: true,
},
{
permission: "hub:content:manage",
dependencies: ["hub:content:edit"],
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const DiscussionPermissions = [
"hub:discussion:workspace:collaborators",
"hub:discussion:workspace:discussion",
"hub:discussion:workspace:metrics",
"hub:discussion:manage",
] as const;

/**
Expand Down Expand Up @@ -86,4 +87,8 @@ export const DiscussionPermissionPolicies: IPermissionPolicy[] = [
permission: "hub:discussion:workspace:metrics",
dependencies: ["hub:discussion:edit"],
},
{
permission: "hub:discussion:manage",
dependencies: ["hub:discussion:edit"],
},
];
5 changes: 5 additions & 0 deletions packages/common/src/groups/_internal/GroupBusinessRules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const GroupPermissions = [
"hub:group:workspace:content",
"hub:group:workspace:members",
"hub:group:shareContent",
"hub:group:manage",
] as const;

/**
Expand Down Expand Up @@ -88,4 +89,8 @@ export const GroupPermissionPolicies: IPermissionPolicy[] = [
},
],
},
{
permission: "hub:group:manage",
dependencies: ["hub:group:edit"],
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const InitiativePermissions = [
"hub:initiative:workspace:collaborators",
"hub:initiative:workspace:content",
"hub:initiative:workspace:metrics",
"hub:initiative:manage",
] as const;

/**
Expand Down Expand Up @@ -108,4 +109,8 @@ export const InitiativePermissionPolicies: IPermissionPolicy[] = [
permission: "hub:initiative:workspace:metrics",
dependencies: ["hub:initiative:edit"],
},
{
permission: "hub:initiative:manage",
dependencies: ["hub:initiative:edit"],
},
];
5 changes: 5 additions & 0 deletions packages/common/src/pages/_internal/PageBusinessRules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const PagePermissions = [
"hub:page:workspace:details",
"hub:page:workspace:settings",
"hub:page:workspace:collaborators",
"hub:page:manage",
] as const;

/**
Expand Down Expand Up @@ -77,6 +78,10 @@ export const PagePermissionPolicies: IPermissionPolicy[] = [
dependencies: ["hub:page:edit"],
entityOwner: true,
},
{
permission: "hub:page:manage",
dependencies: ["hub:page:edit"],
},
];

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const ProjectPermissions = [
"hub:project:workspace:collaborators",
"hub:project:workspace:content",
"hub:project:workspace:metrics",
"hub:project:manage",
] as const;

/**
Expand Down Expand Up @@ -114,4 +115,8 @@ export const ProjectPermissionPolicies: IPermissionPolicy[] = [
permission: "hub:project:workspace:metrics",
dependencies: ["hub:project:edit"],
},
{
permission: "hub:project:manage",
dependencies: ["hub:project:edit"],
},
];
5 changes: 5 additions & 0 deletions packages/common/src/sites/_internal/SiteBusinessRules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export const SitePermissions = [
"hub:site:workspace:followers",
"hub:site:workspace:followers:member",
"hub:site:workspace:followers:manager",
"hub:site:manage",
] as const;

/**
Expand Down Expand Up @@ -136,6 +137,10 @@ export const SitesPermissionPolicies: IPermissionPolicy[] = [
},
],
},
{
permission: "hub:site:manage",
dependencies: ["hub:site:edit"],
},
];

/**
Expand Down

0 comments on commit 71191b7

Please sign in to comment.