Beispiel #1
0
    public static bool DeletePermission(string permissionName, string resourceName)
    {
        PermissionNameInfo deletePermission = PermissionNameInfoProvider.GetPermissionNameInfo(permissionName, resourceName, null);

        PermissionNameInfoProvider.DeletePermissionInfo(deletePermission);
        return(deletePermission != null);
    }
Beispiel #2
0
    /// <summary>
    /// Deletes permission. Called when the "Delete permission" button is pressed.
    /// Expects the CreatePermission method to be run first.
    /// </summary>
    private bool DeletePermission()
    {
        // Get the permission
        PermissionNameInfo deletePermission = PermissionNameInfoProvider.GetPermissionNameInfo("MyNewPermission", "MyNewModule", null);

        // Delete the permission
        PermissionNameInfoProvider.DeletePermissionInfo(deletePermission);

        return(deletePermission != null);
    }
Beispiel #3
0
 /// <summary>
 /// Handles the UniGrid's OnAction event.
 /// </summary>
 /// <param name="actionName">Name of item (button) that threw event</param>
 /// <param name="actionArgument">ID (value of Primary key) of corresponding data row</param>
 protected void UniGridPermissionList_OnAction(string actionName, object actionArgument)
 {
     if (actionName == "edit")
     {
         URLHelper.Redirect(string.Format(@"Module_Edit_PermissionName_Edit_Frameset.aspx?moduleId={0}&permissionId={1}", this.mModuleId, actionArgument));
     }
     else if (actionName == "delete")
     {
         PermissionNameInfoProvider.DeletePermissionInfo(ValidationHelper.GetInteger(actionArgument, 0));
     }
     else if (actionName == "moveup")
     {
         PermissionNameInfoProvider.MovePermissionUp(ValidationHelper.GetInteger(actionArgument, 0));
     }
     else if (actionName == "movedown")
     {
         PermissionNameInfoProvider.MovePermissionDown(ValidationHelper.GetInteger(actionArgument, 0));
     }
 }