}
#[throws(MgmtError)]
- fn start_modify_game(game: &InstanceName)
+ fn start_access_game(game: &InstanceName)
-> (AccountsGuard, Unauthorised<InstanceRef, InstanceName>)
{
(
MC::UploadBundle { game, size, hash, kind } => {
let (upload, auth) = {
- let (ag, gref) = start_modify_game(&game)?;
+ let (ag, gref) = start_access_game(&game)?;
modify_bundles(
cs,&ag,&gref, &[TP::UploadBundles],
&mut |mut ig, mut bundles: BundlesGuard<'_>| {
Fine
}
MC::ListBundles { game } => {
- let (ag, gref) = start_modify_game(&game)?;
+ let (ag, gref) = start_access_game(&game)?;
let mut igu = gref.lock()?;
let (ig, _) = cs.check_acl(&ag, &mut igu, PCH::Instance,
TP_ACCESS_BUNDLES)?;
Fine
}
MC::ClearBundles { game } => {
- let (ag, gref) = start_modify_game(&game)?;
+ let (ag, gref) = start_access_game(&game)?;
modify_bundles(
cs,&ag,&gref, &[TP::ClearBundles],
&mut |mut ig, mut bundles: BundlesGuard<'_>| {
}
MC::AlterGame { game, insns, how } => {
- let (mut ag, gref) = start_modify_game(&game)?;
+ let (mut ag, gref) = start_access_game(&game)?;
let mut g = gref.lock()?;
execute_for_game(cs, &mut ag, &mut g, insns, how)?
}