mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-02 20:18:08 +00:00
## Description Add account delete option in the user account settings. Fixes #1555 ## Type of change - [ ] New feature (non-breaking change which adds functionality)   ## Checklist: - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented on my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published in downstream modules --------- Co-authored-by: Sojan Jose <sojan@pepalo.com> Co-authored-by: Sojan Jose <sojan.official@gmail.com> Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
34 lines
552 B
Ruby
34 lines
552 B
Ruby
class AccountPolicy < ApplicationPolicy
|
|
def show?
|
|
@account_user.administrator? || @account_user.agent?
|
|
end
|
|
|
|
def cache_keys?
|
|
@account_user.administrator? || @account_user.agent?
|
|
end
|
|
|
|
def limits?
|
|
@account_user.administrator? || @account_user.agent?
|
|
end
|
|
|
|
def update?
|
|
@account_user.administrator?
|
|
end
|
|
|
|
def update_active_at?
|
|
true
|
|
end
|
|
|
|
def subscription?
|
|
@account_user.administrator?
|
|
end
|
|
|
|
def checkout?
|
|
@account_user.administrator?
|
|
end
|
|
|
|
def toggle_deletion?
|
|
@account_user.administrator?
|
|
end
|
|
end
|