2023-09-17 00:45:57 +03:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
|
|
class Ability
|
|
|
|
|
include CanCan::Ability
|
|
|
|
|
|
|
|
|
|
def initialize(user)
|
|
|
|
|
can :manage, Template, account_id: user.account_id
|
2023-09-21 00:23:38 +03:00
|
|
|
can :manage, TemplateFolder, account_id: user.account_id
|
2023-09-17 00:45:57 +03:00
|
|
|
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
|
2023-09-22 21:50:39 +03:00
|
|
|
can :manage, UserConfig, user_id: user.id
|
2023-09-17 00:45:57 +03:00
|
|
|
can :manage, Account, id: user.account_id
|
|
|
|
|
can :manage, AccessToken, user_id: user.id
|
|
|
|
|
end
|
|
|
|
|
end
|