Skip to content

Commit

Permalink
check the module permission to add module
Browse files Browse the repository at this point in the history
  • Loading branch information
zyhfish committed Oct 22, 2020
1 parent 49b7291 commit 7ebe949
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,10 @@ private int DoAddExistingModule(int moduleId, int tabId, string paneName, int po
break;
}
}
else if (!ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Edit, "MANAGE", moduleInfo))
{
throw new SecurityException($"Module '{moduleInfo.ModuleID}' is not available in current context.");
}

// clone the module object ( to avoid creating an object reference to the data cache )
ModuleInfo newModule = moduleInfo.Clone();
Expand Down

0 comments on commit 7ebe949

Please sign in to comment.