Skip to content

Commit

Permalink
add namespace check
Browse files Browse the repository at this point in the history
  • Loading branch information
holic committed Jan 18, 2024
1 parent d88c6a7 commit 73b5ded
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ contract AccessManagementSystem is System {
* @param newOwner The address to which ownership should be transferred.
*/
function transferOwnership(ResourceId namespaceId, address newOwner) public virtual {
// Require the namespace to be a valid namespace ID
// Require the namespace ID to be a valid namespace
requireNamespace(namespaceId);

// Require the namespace to exist
Expand All @@ -76,6 +76,9 @@ contract AccessManagementSystem is System {
* @param namespaceId The ID of the namespace to transfer ownership.
*/
function renounceOwnership(ResourceId namespaceId) public virtual {
// Require the namespace ID to be a valid namespace
requireNamespace(namespaceId);

// Require the caller to own the namespace
AccessControl.requireOwner(namespaceId, _msgSender());

Expand Down

0 comments on commit 73b5ded

Please sign in to comment.