public static bool HasRequiredPermissions(Application app, NodeHead contextHead) { if (app == null) { return(true); } var perms = GetRequiredPermissions(app); return(perms.All(permType => SecurityHandler.HasPermission(contextHead, permType) && (!app.DeepPermissionCheck || SecurityHandler.HasSubTreePermission(contextHead, permType)))); }
/// <summary> /// Returns true if all passed permissions are allowed for the current user on every content in the whole subtree of the current content. /// </summary> /// <param name="permissionTypes">Set of related permissions. Cannot be null. Empty set means "allowed nothing".</param> public bool HasSubTreePermission(params PermissionType[] permissionTypes) { return(_securityHandler.HasSubTreePermission(_node, permissionTypes)); }