Skip to content

Commit 198569a

Browse files
Merge branch 'main' into feature/benchmarks
2 parents 9954101 + 5cc43e4 commit 198569a

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

pallets/afloat/src/functions.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -957,6 +957,7 @@ impl<T: Config> Pallet<T> {
957957
}
958958
Ok::<(), DispatchError>(())
959959
})?;
960+
<T as pallet::Config>::Rbac::remove_pallet_storage(Self::pallet_id())?;
960961
Ok(())
961962
}
962963

pallets/rbac/src/lib.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,5 +312,16 @@ pub mod pallet {
312312
Self::do_remove_permission_from_pallet(pallet, permission_id)?;
313313
Ok(())
314314
}
315+
316+
#[pallet::call_index(6)]
317+
#[pallet::weight(Weight::from_parts(10_000,0) + T::DbWeight::get().writes(1))]
318+
pub fn remove_pallet_permissions(origin: OriginFor<T>, pallet: IdOrVec) -> DispatchResult {
319+
ensure!(
320+
T::RemoveOrigin::ensure_origin(origin.clone()).is_ok(),
321+
Error::<T>::NotAuthorized
322+
);
323+
Self::remove_pallet_storage(pallet)?;
324+
Ok(())
325+
}
315326
}
316327
}

0 commit comments

Comments
 (0)