MCPcopy Create free account
hub / github.com/dfinity/orbit / get_user_group

Method get_user_group

core/station/impl/src/controllers/user_group.rs:42–56  ·  view source on GitHub ↗
(&self, input: GetUserGroupInput)

Source from the content-addressed store, hash-verified

40
41 #[with_middleware(guard = authorize(&call_context(), &[Resource::from(&input)]))]
42 async fn get_user_group(&self, input: GetUserGroupInput) -> ApiResult<GetUserGroupResponse> {
43 let ctx = call_context();
44 let user_group = self
45 .user_group_service
46 .get(HelperMapper::to_uuid(input.user_group_id)?.as_bytes())?;
47 let privileges = self
48 .user_group_service
49 .get_caller_privileges_for_user_group(&user_group.id, &ctx)
50 .await?;
51
52 Ok(GetUserGroupResponse {
53 user_group: user_group.into(),
54 privileges: privileges.into(),
55 })
56 }
57
58 #[with_middleware(guard = authorize(&call_context(), &[Resource::UserGroup(ResourceAction::List)]))]
59 async fn list_user_groups(

Callers 2

get_user_groupFunction · 0.80
getUserGroupMethod · 0.80

Calls 3

call_contextFunction · 0.50
getMethod · 0.45

Tested by

no test coverage detected