sea_orm/rbac/engine/
permission_request.rs1use crate::rbac::entity::permission::Model as Permission;
2
3#[derive(Debug)]
4pub struct Action<'a>(pub &'a str);
5
6#[derive(Debug, Clone, PartialEq, Eq, Hash)]
7pub struct PermissionRequest {
8 pub action: String,
9}
10
11impl<'a> From<Action<'a>> for PermissionRequest {
12 fn from(action: Action<'a>) -> PermissionRequest {
13 PermissionRequest {
14 action: action.0.to_owned(),
15 }
16 }
17}
18
19impl From<Permission> for PermissionRequest {
20 fn from(permission: Permission) -> Self {
21 Self {
22 action: permission.action,
23 }
24 }
25}