Class PermissionsGrid
Inheritance
Implements
Namespace: DotNetNuke.Security.Permissions.Controls
Assembly: DotNetNuke.dll
Syntax
public abstract class PermissionsGrid : Control
Constructors
| Improve this Doc View SourcePermissionsGrid()
Initializes a new instance of the PermissionsGrid class.
Declaration
public PermissionsGrid()
Fields
| Improve this Doc View SourcePermissionTypeDeny
Declaration
protected const string PermissionTypeDeny = null
Field Value
| Type | Description |
|---|---|
| System.String |
PermissionTypeGrant
Declaration
protected const string PermissionTypeGrant = null
Field Value
| Type | Description |
|---|---|
| System.String |
PermissionTypeNull
Declaration
protected const string PermissionTypeNull = null
Field Value
| Type | Description |
|---|---|
| System.String |
rolePermissionsGrid
Declaration
protected DataGrid rolePermissionsGrid
Field Value
| Type | Description |
|---|---|
| DataGrid |
userPermissionsGrid
Declaration
protected DataGrid userPermissionsGrid
Field Value
| Type | Description |
|---|---|
| DataGrid |
Properties
| Improve this Doc View SourceAdministratorRoleId
Gets the Id of the Administrator Role.
Declaration
public int AdministratorRoleId { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
AlternatingItemStyle
Declaration
public TableItemStyle AlternatingItemStyle { get; }
Property Value
| Type | Description |
|---|---|
| TableItemStyle |
AutoGenerateColumns
Declaration
public bool AutoGenerateColumns { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
CellSpacing
Declaration
public int CellSpacing { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Columns
Declaration
public DataGridColumnCollection Columns { get; }
Property Value
| Type | Description |
|---|---|
| DataGridColumnCollection |
dtRolePermissions
Gets the underlying Permissions Data Table.
Declaration
public DataTable dtRolePermissions { get; }
Property Value
| Type | Description |
|---|---|
| DataTable |
dtUserPermissions
Gets the underlying Permissions Data Table.
Declaration
public DataTable dtUserPermissions { get; }
Property Value
| Type | Description |
|---|---|
| DataTable |
DynamicColumnAdded
Gets or sets a value indicating whether a Dynamic Column has been added.
Declaration
public bool DynamicColumnAdded { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
FooterStyle
Declaration
public TableItemStyle FooterStyle { get; }
Property Value
| Type | Description |
|---|---|
| TableItemStyle |
GridLines
Declaration
public GridLines GridLines { get; set; }
Property Value
| Type | Description |
|---|---|
| GridLines |
HeaderStyle
Declaration
public TableItemStyle HeaderStyle { get; }
Property Value
| Type | Description |
|---|---|
| TableItemStyle |
Items
Declaration
public DataGridItemCollection Items { get; }
Property Value
| Type | Description |
|---|---|
| DataGridItemCollection |
ItemStyle
Declaration
public TableItemStyle ItemStyle { get; }
Property Value
| Type | Description |
|---|---|
| TableItemStyle |
PermissionsList
Declaration
protected virtual List<PermissionInfoBase> PermissionsList { get; }
Property Value
| Type | Description |
|---|---|
| List<PermissionInfoBase> |
PortalId
Gets the Id of the Portal.
Declaration
public int PortalId { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
RefreshGrid
Declaration
protected virtual bool RefreshGrid { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
RegisteredUsersRoleId
Gets the Id of the Registered Users Role.
Declaration
public int RegisteredUsersRoleId { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
ResourceFile
Gets or sets the ResourceFile to localize permissions.
Declaration
public string ResourceFile { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Roles
Gets or sets the collection of Roles to display.
Declaration
public ArrayList Roles { get; set; }
Property Value
| Type | Description |
|---|---|
| ArrayList |
SelectedItemStyle
Declaration
public TableItemStyle SelectedItemStyle { get; }
Property Value
| Type | Description |
|---|---|
| TableItemStyle |
Methods
| Improve this Doc View SourceAddPermission(ArrayList, UserInfo)
Updates a Permission.
Declaration
protected virtual void AddPermission(ArrayList permissions, UserInfo user)
Parameters
| Type | Name | Description |
|---|---|---|
| ArrayList | permissions | The permissions collection. |
| UserInfo | user | The user to add. |
AddPermission(ArrayList, RoleInfo)
Updates a Permission.
Declaration
protected virtual void AddPermission(ArrayList permissions, RoleInfo role)
Parameters
| Type | Name | Description |
|---|---|---|
| ArrayList | permissions | The permissions collection. |
| RoleInfo | role | The role to add. |
AddPermission(PermissionInfo, Int32, String, Int32, String, Boolean)
Declaration
protected virtual void AddPermission(PermissionInfo permission, int roleId, string roleName, int userId, string displayName, bool allowAccess)
Parameters
| Type | Name | Description |
|---|---|---|
| PermissionInfo | permission | |
| System.Int32 | roleId | |
| System.String | roleName | |
| System.Int32 | userId | |
| System.String | displayName | |
| System.Boolean | allowAccess |
AddUser(Object, EventArgs)
AddUser runs when the Add user linkbutton is clicked.
Declaration
protected virtual void AddUser(object sender, EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | sender | |
| EventArgs | e |
BuildKey(Boolean, Int32, Int32, Int32, String, Int32, String)
Builds the key used to store the "permission" information in the ViewState.
Declaration
protected string BuildKey(bool allowAccess, int permissionId, int objectPermissionId, int roleId, string roleName, int userID, string displayName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | allowAccess | The type of permission ( grant / deny ). |
| System.Int32 | permissionId | The Id of the permission. |
| System.Int32 | objectPermissionId | The Id of the object permission. |
| System.Int32 | roleId | The role id. |
| System.String | roleName | The role name. |
| System.Int32 | userID | The user id. |
| System.String | displayName | The user display name. |
Returns
| Type | Description |
|---|---|
| System.String | The permission state key. |
BuildKey(Boolean, Int32, Int32, Int32, String)
Builds the key used to store the "permission" information in the ViewState.
Declaration
protected string BuildKey(bool allowAccess, int permissionId, int objectPermissionId, int roleId, string roleName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | allowAccess | The type of permission ( grant / deny ). |
| System.Int32 | permissionId | The Id of the permission. |
| System.Int32 | objectPermissionId | The Id of the object permission. |
| System.Int32 | roleId | The role id. |
| System.String | roleName | The role name. |
Returns
| Type | Description |
|---|---|
| System.String | The permission state key. |
CreateChildControls()
Declaration
protected override void CreateChildControls()
GenerateDataGrid()
Generate the Data Grid.
Declaration
public abstract void GenerateDataGrid()
GetEnabled(PermissionInfo, UserInfo, Int32)
Gets the Enabled status of the permission.
Declaration
protected virtual bool GetEnabled(PermissionInfo objPerm, UserInfo user, int column)
Parameters
| Type | Name | Description |
|---|---|---|
| PermissionInfo | objPerm | The permission being loaded. |
| UserInfo | user | The user. |
| System.Int32 | column | The column of the Grid. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the permission is enabled, otherwise false. |
GetEnabled(PermissionInfo, RoleInfo, Int32)
Gets the Enabled status of the permission.
Declaration
protected virtual bool GetEnabled(PermissionInfo objPerm, RoleInfo role, int column)
Parameters
| Type | Name | Description |
|---|---|---|
| PermissionInfo | objPerm | The permission being loaded. |
| RoleInfo | role | The role. |
| System.Int32 | column | The column of the Grid. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the permission is enabled, otherwise false. |
GetPermission(PermissionInfo, UserInfo, Int32, String)
Gets the Value of the permission.
Declaration
protected virtual string GetPermission(PermissionInfo objPerm, UserInfo user, int column, string defaultState)
Parameters
| Type | Name | Description |
|---|---|---|
| PermissionInfo | objPerm | The permission being loaded. |
| UserInfo | user | The user. |
| System.Int32 | column | The column of the Grid. |
| System.String | defaultState | Default State. |
Returns
| Type | Description |
|---|---|
| System.String | The permission state (one of PermissionTypeGrant, PermissionTypeDeny or |
GetPermission(PermissionInfo, UserInfo, Int32)
Gets the Value of the permission.
Declaration
protected virtual bool GetPermission(PermissionInfo objPerm, UserInfo user, int column)
Parameters
| Type | Name | Description |
|---|---|---|
| PermissionInfo | objPerm | The permission being loaded. |
| UserInfo | user | The user. |
| System.Int32 | column | The column of the Grid. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the permission is granted, otherwise false. |
GetPermission(PermissionInfo, RoleInfo, Int32, String)
Gets the Value of the permission.
Declaration
protected virtual string GetPermission(PermissionInfo objPerm, RoleInfo role, int column, string defaultState)
Parameters
| Type | Name | Description |
|---|---|---|
| PermissionInfo | objPerm | The permission being loaded. |
| RoleInfo | role | The role. |
| System.Int32 | column | The column of the Grid. |
| System.String | defaultState | Default State. |
Returns
| Type | Description |
|---|---|
| System.String | The permission state (one of PermissionTypeGrant, PermissionTypeDeny or |
GetPermission(PermissionInfo, RoleInfo, Int32)
Gets the Value of the permission.
Declaration
protected virtual bool GetPermission(PermissionInfo objPerm, RoleInfo role, int column)
Parameters
| Type | Name | Description |
|---|---|---|
| PermissionInfo | objPerm | The permission being loaded. |
| RoleInfo | role | The role. |
| System.Int32 | column | The column of the Grid. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the permission is granted, otherwise false. |
GetPermissions()
Gets the permissions from the Database.
Declaration
protected virtual ArrayList GetPermissions()
Returns
| Type | Description |
|---|---|
| ArrayList | An |
GetUsers()
Gets the users from the Database.
Declaration
protected virtual ArrayList GetUsers()
Returns
| Type | Description |
|---|---|
| ArrayList | An |
IsFullControl(PermissionInfo)
Declaration
protected virtual bool IsFullControl(PermissionInfo permissionInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| PermissionInfo | permissionInfo |
Returns
| Type | Description |
|---|---|
| System.Boolean |
IsViewPermisison(PermissionInfo)
Declaration
protected virtual bool IsViewPermisison(PermissionInfo permissionInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| PermissionInfo | permissionInfo |
Returns
| Type | Description |
|---|---|
| System.Boolean |
OnInit(EventArgs)
Declaration
protected override void OnInit(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| EventArgs | e |
OnPreRender(EventArgs)
Overrides the base OnPreRender method to Bind the Grid to the Permissions.
Declaration
protected override void OnPreRender(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| EventArgs | e |
ParsePermissionKeys(PermissionInfoBase, String[])
Declaration
protected virtual void ParsePermissionKeys(PermissionInfoBase permission, string[] settings)
Parameters
| Type | Name | Description |
|---|---|---|
| PermissionInfoBase | permission | |
| System.String[] | settings |
RegisterScriptsForAjaxPanel()
Registers the scripts necessary to make the tri-state controls work inside a RadAjaxPanel.
Declaration
public void RegisterScriptsForAjaxPanel()
Remarks
No need to call this unless using the PermissionGrid inside an ajax control that omits scripts on postback See DesktopModules/Admin/Tabs.ascx.cs for an example of usage.
RemovePermission(Int32, Int32, Int32)
Declaration
protected virtual void RemovePermission(int permissionID, int roleID, int userID)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | permissionID | |
| System.Int32 | roleID | |
| System.Int32 | userID |
RoleGroupsSelectedIndexChanged(Object, EventArgs)
RoleGroupsSelectedIndexChanged runs when the Role Group is changed.
Declaration
protected virtual void RoleGroupsSelectedIndexChanged(object sender, EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | sender | |
| EventArgs | e |
SupportsDenyPermissions(PermissionInfo)
Declaration
protected virtual bool SupportsDenyPermissions(PermissionInfo permissionInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| PermissionInfo | permissionInfo |
Returns
| Type | Description |
|---|---|
| System.Boolean |
UpdatePermission(PermissionInfo, Int32, String, Boolean)
Updates a Permission.
Declaration
protected virtual void UpdatePermission(PermissionInfo permission, int roleId, string roleName, bool allowAccess)
Parameters
| Type | Name | Description |
|---|---|---|
| PermissionInfo | permission | The permission being updated. |
| System.Int32 | roleId | Role Id. |
| System.String | roleName | The name of the role. |
| System.Boolean | allowAccess | The value of the permission. |
UpdatePermission(PermissionInfo, Int32, String, String)
Updates a Permission.
Declaration
protected virtual void UpdatePermission(PermissionInfo permission, int roleId, string roleName, string stateKey)
Parameters
| Type | Name | Description |
|---|---|---|
| PermissionInfo | permission | The permission being updated. |
| System.Int32 | roleId | Role Id. |
| System.String | roleName | The name of the role. |
| System.String | stateKey | The permission state. |
UpdatePermission(PermissionInfo, String, Int32, Boolean)
Updates a Permission.
Declaration
protected virtual void UpdatePermission(PermissionInfo permission, string displayName, int userId, bool allowAccess)
Parameters
| Type | Name | Description |
|---|---|---|
| PermissionInfo | permission | The permission being updated. |
| System.String | displayName | The user's display name. |
| System.Int32 | userId | The user's id. |
| System.Boolean | allowAccess | The value of the permission. |
UpdatePermission(PermissionInfo, String, Int32, String)
Updates a Permission.
Declaration
protected virtual void UpdatePermission(PermissionInfo permission, string displayName, int userId, string stateKey)
Parameters
| Type | Name | Description |
|---|---|---|
| PermissionInfo | permission | The permission being updated. |
| System.String | displayName | The user's display name. |
| System.Int32 | userId | The user's id. |
| System.String | stateKey | The permission state. |
UpdatePermissions()
Updates the permissions.
Declaration
protected void UpdatePermissions()
UpdateRolePermissions()
Updates the permissions.
Declaration
protected void UpdateRolePermissions()
UpdateUserPermissions()
Updates the permissions.
Declaration
protected void UpdateUserPermissions()