refactor(permissions): drop explanatory comments, fix stale PostPolicy docblock

This commit is contained in:
Paulo Castellano 2026-06-22 16:35:27 -03:00
parent 5bb39da598
commit 0eb6f4df24
3 changed files with 2 additions and 5 deletions

View file

@ -25,7 +25,8 @@ public function view(User $user, Post $post): bool|Response
}
/**
* Authorize updating a post. Same workspace-tenancy guard as `view`.
* Authorize updating a post: tenancy guard (404 across tenants) then the
* role gate viewers are read-only (403).
*/
public function update(User $user, Post $post): bool|Response
{

View file

@ -119,7 +119,6 @@ const workspaceNavItems = computed<NavItem[]>(() => [
href: accounts.url(),
icon: IconAffiliate,
},
// Signatures / labels / assets are content-authoring tools (member+ only).
...(canCreatePost.value
? [
{

View file

@ -28,14 +28,11 @@ export const useWorkspaceRole = () => {
isOwner,
isAdminOrAbove,
isMemberOrAbove,
// member+ (owner/admin/member) — content authoring
canCreatePost: isMemberOrAbove,
canManageAutomations: isMemberOrAbove,
// admin+ (owner/admin) — workspace administration
canManageAccounts: isAdminOrAbove,
canManageTeam: isAdminOrAbove,
canManageWorkspace: isAdminOrAbove,
// owner only
canManageBilling: isOwner,
canCreateWorkspace: isOwner,
};