Grant delete_any_post and delete_any_profile permissions to admin role

This commit is contained in:
silverpill 2023-03-19 19:20:36 +00:00
parent b80b827fde
commit e3ee144889
4 changed files with 9 additions and 0 deletions

View file

@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Changed
- Documented valid role names for `set-role` command.
- Granted `delete_any_post` and `delete_any_profile` permissions to admin role.
### Fixed

View file

@ -1782,6 +1782,8 @@ components:
enum:
- create_follow_request
- create_post
- delete_any_post
- delete_any_profile
- manage_subscription_options
Signature:
type: object

View file

@ -84,6 +84,8 @@ impl ApiRole {
match permission {
Permission::CreateFollowRequest => "create_follow_request",
Permission::CreatePost => "create_post",
Permission::DeleteAnyPost => "delete_any_post",
Permission::DeleteAnyProfile => "delete_any_profile",
Permission::ManageSubscriptionOptions =>
"manage_subscription_options",
}.to_string()

View file

@ -29,6 +29,8 @@ pub struct DbInviteCode {
pub enum Permission {
CreateFollowRequest,
CreatePost,
DeleteAnyPost,
DeleteAnyProfile,
ManageSubscriptionOptions,
}
@ -66,6 +68,8 @@ impl Role {
Self::Admin => vec![
Permission::CreateFollowRequest,
Permission::CreatePost,
Permission::DeleteAnyPost,
Permission::DeleteAnyProfile,
Permission::ManageSubscriptionOptions,
],
Self::ReadOnlyUser => vec![