Skip to content

permissions context #436

@LaserUnicorns

Description

@LaserUnicorns

It would be nice to have some mechanism for nesting permission options (sref, except, only, authorized/unauthorized methods).

For example

<!-- defines context -->
<div permission-context permission-only="'dashboard.view'"> 
  <h1>Hello!</h1>

  <!-- defines nested context and partially(?) overrides options -->
  <div permission-context permission-only="'dashboard.edit'"> 

    <!-- uses permission from context -->
    <input permission> 
    <button permission><button>

    <!-- partially overrides context options -->
    <input type="password" permission permission-only="'dashboard.editPassword'"> 
  </div>
</div>

That way we can write reusable permissions-aware components without explicitly specifying permissions/roles in them. Also reduces boilerplate when we have many elements with the same permissions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions