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

Merge has_user_access?/4 args and pass entire object to has_user_access?/3 #20

Merged
merged 12 commits into from
Nov 7, 2019

Conversation

rschef
Copy link
Collaborator

@rschef rschef commented Nov 7, 2019

Closes #19

Current callback:

@callback has_user_access?(
    current_user,
    scope :: module(),
    {field :: any(), field_value :: any()},
    rule :: any()
  ) :: boolean()
  • Merge scope module and {field, field_value} arguments into a struct, since scope module must define a struct
  • Pass entire objects from field and query scope authorization to new has_user_access?/3
  • Rename scope_by, scope_object_by and scope_field_by metas to scope?, scope_object? and scope_field?
  • Set default scope? value to true

…ccess?/3 and replace scope_by and scope_object_by metas by scope? and scope_object?
…o context_role_authorized? and context_user_authorized?
…3 and replace scope_by and scope_field_by metas by scope? and scope_field?
@rschef rschef changed the title 19 merge has user access args Merge has_user_access?/4 args and pass entire object to has_user_access?/3 Nov 7, 2019
README.md Outdated Show resolved Hide resolved
lib/middlewares/field_authorization.ex Outdated Show resolved Hide resolved
lib/middlewares/object_scope_authorization.ex Outdated Show resolved Hide resolved
lib/rajska.ex Show resolved Hide resolved
lib/middlewares/query_scope_authorization.ex Outdated Show resolved Hide resolved
@rschef rschef merged commit 89c2d66 into master Nov 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Merge has_user_access?/4 args and pass entire object to has_user_access?/3
2 participants