mirror of
https://github.com/docusealco/docuseal
synced 2026-11-04 14:42:32 -05:00
add cancan for authorization
This commit is contained in:
1 parent
f89c50d096
commit
2f1843151d
58 files changed
+341
-184
No files matched your search
@@ -0,0 +1,16 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Ability
|
||||
include CanCan::Ability
|
||||
|
||||
def initialize(user)
|
||||
can :manage, Template, account_id: user.account_id
|
||||
can :manage, Submission, template: { account_id: user.account_id }
|
||||
can :manage, Submitter, template: { account_id: user.account_id }
|
||||
can :manage, User, account_id: user.account_id
|
||||
can :manage, EncryptedConfig, account_id: user.account_id
|
||||
can :manage, AccountConfig, account_id: user.account_id
|
||||
can :manage, Account, id: user.account_id
|
||||
can :manage, AccessToken, user_id: user.id
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user