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

Add a client-side counterpart #40

Open
Alfredo-Delgado opened this issue Aug 22, 2018 · 0 comments
Open

Add a client-side counterpart #40

Alfredo-Delgado opened this issue Aug 22, 2018 · 0 comments

Comments

@Alfredo-Delgado
Copy link

Alfredo-Delgado commented Aug 22, 2018

After integrating feathers-permissions (backed by PostgreSQL), I want to make it possible for UI devs to use the same logic.

contrived example: class="'userInstance.can('item:remove') || 'disabled'"

I'd like to move https://github.com/feathersjs-ecosystem/feathers-permissions/blob/master/lib/index.js#L39-L60 into its own function so that it can be used by the existing hook and a more generic implementation.

e.g.

permissionsContain(permissions, roles, method);

checkPermission(permission, permissions);
checkPermission('item:get', [ 'item:*' ]);

FrontendUserModel.prototype.can = function(permission) {
  return checkPermission(permission, this.permissions);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants