Class PermissionProvider
Namespace: DotNetNuke.Security.Permissions
Assembly: DotNetNuke.dll
Syntax
public class PermissionProvider : object
Properties
| Improve this Doc View SourceLocalResourceFile
Declaration
public virtual string LocalResourceFile { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
| Improve this Doc View SourceCanAddContentToPage(TabInfo)
Returns a flag indicating whether the current user can add content to a page.
Declaration
public virtual bool CanAddContentToPage(TabInfo tab)
Parameters
Type | Name | Description |
---|---|---|
TabInfo | tab | The page. |
Returns
Type | Description |
---|---|
System.Boolean | A flag indicating whether the user has permission. |
CanAddFolder(FolderInfo)
Returns a flag indicating whether the current user can add a folder or file.
Declaration
public virtual bool CanAddFolder(FolderInfo folder)
Parameters
Type | Name | Description |
---|---|---|
FolderInfo | folder | The page. |
Returns
Type | Description |
---|---|
System.Boolean | A flag indicating whether the user has permission. |
CanAddPage(TabInfo)
Returns a flag indicating whether the current user can add a child page to a page.
Declaration
public virtual bool CanAddPage(TabInfo tab)
Parameters
Type | Name | Description |
---|---|---|
TabInfo | tab | The page. |
Returns
Type | Description |
---|---|
System.Boolean | A flag indicating whether the user has permission. |
CanAddTopLevel(Int32)
Returns a flag indicating whether the current user can add top level pages.
Declaration
public virtual bool CanAddTopLevel(int portalId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | The id of the portal. |
Returns
Type | Description |
---|---|
System.Boolean | A flag indicating whether the user has permission. |
CanAdminFolder(FolderInfo)
Returns a flag indicating whether the current user can administer a folder.
Declaration
public virtual bool CanAdminFolder(FolderInfo folder)
Parameters
Type | Name | Description |
---|---|---|
FolderInfo | folder | The page. |
Returns
Type | Description |
---|---|
System.Boolean | A flag indicating whether the user has permission. |
CanAdminModule(ModuleInfo)
Returns a flag indicating whether the current user can administer a module.
Declaration
public virtual bool CanAdminModule(ModuleInfo module)
Parameters
Type | Name | Description |
---|---|---|
ModuleInfo | module | The page. |
Returns
Type | Description |
---|---|
System.Boolean | A flag indicating whether the user has permission. |
CanAdminPage(TabInfo)
Returns a flag indicating whether the current user can administer a page.
Declaration
public virtual bool CanAdminPage(TabInfo tab)
Parameters
Type | Name | Description |
---|---|---|
TabInfo | tab | The page. |
Returns
Type | Description |
---|---|
System.Boolean | A flag indicating whether the user has permission. |
CanBrowseFolder(FolderInfo)
Returns a flag indicating whether the current user can browse the folder.
Declaration
public virtual bool CanBrowseFolder(FolderInfo folder)
Parameters
Type | Name | Description |
---|---|---|
FolderInfo | folder | The page. |
Returns
Type | Description |
---|---|
System.Boolean | A flag indicating whether the user has permission. |
CanCopyFolder(FolderInfo)
Returns a flag indicating whether the current user can copy a folder or file.
Declaration
public virtual bool CanCopyFolder(FolderInfo folder)
Parameters
Type | Name | Description |
---|---|---|
FolderInfo | folder | The page. |
Returns
Type | Description |
---|---|
System.Boolean | A flag indicating whether the user has permission. |
CanCopyPage(TabInfo)
Returns a flag indicating whether the current user can copy a page.
Declaration
public virtual bool CanCopyPage(TabInfo tab)
Parameters
Type | Name | Description |
---|---|---|
TabInfo | tab | The page. |
Returns
Type | Description |
---|---|
System.Boolean | A flag indicating whether the user has permission. |
CanDeleteFolder(FolderInfo)
Returns a flag indicating whether the current user can delete a folder or file.
Declaration
public virtual bool CanDeleteFolder(FolderInfo folder)
Parameters
Type | Name | Description |
---|---|---|
FolderInfo | folder | The page. |
Returns
Type | Description |
---|---|
System.Boolean | A flag indicating whether the user has permission. |
CanDeleteModule(ModuleInfo)
Returns a flag indicating whether the current user can delete a module.
Declaration
public virtual bool CanDeleteModule(ModuleInfo module)
Parameters
Type | Name | Description |
---|---|---|
ModuleInfo | module | The page. |
Returns
Type | Description |
---|---|
System.Boolean | A flag indicating whether the user has permission. |
CanDeletePage(TabInfo)
Returns a flag indicating whether the current user can delete a page.
Declaration
public virtual bool CanDeletePage(TabInfo tab)
Parameters
Type | Name | Description |
---|---|---|
TabInfo | tab | The page. |
Returns
Type | Description |
---|---|
System.Boolean | A flag indicating whether the user has permission. |
CanEditModuleContent(ModuleInfo)
Returns a flag indicating whether the current user can edit module content.
Declaration
public virtual bool CanEditModuleContent(ModuleInfo module)
Parameters
Type | Name | Description |
---|---|---|
ModuleInfo | module | The page. |
Returns
Type | Description |
---|---|
System.Boolean | A flag indicating whether the user has permission. |
CanExportModule(ModuleInfo)
Returns a flag indicating whether the current user can export a module.
Declaration
public virtual bool CanExportModule(ModuleInfo module)
Parameters
Type | Name | Description |
---|---|---|
ModuleInfo | module | The page. |
Returns
Type | Description |
---|---|
System.Boolean | A flag indicating whether the user has permission. |
CanExportPage(TabInfo)
Returns a flag indicating whether the current user can export a page.
Declaration
public virtual bool CanExportPage(TabInfo tab)
Parameters
Type | Name | Description |
---|---|---|
TabInfo | tab | The page. |
Returns
Type | Description |
---|---|
System.Boolean | A flag indicating whether the user has permission. |
CanImportModule(ModuleInfo)
Returns a flag indicating whether the current user can import a module.
Declaration
public virtual bool CanImportModule(ModuleInfo module)
Parameters
Type | Name | Description |
---|---|---|
ModuleInfo | module | The page. |
Returns
Type | Description |
---|---|
System.Boolean | A flag indicating whether the user has permission. |
CanImportPage(TabInfo)
Returns a flag indicating whether the current user can import a page.
Declaration
public virtual bool CanImportPage(TabInfo tab)
Parameters
Type | Name | Description |
---|---|---|
TabInfo | tab | The page. |
Returns
Type | Description |
---|---|
System.Boolean | A flag indicating whether the user has permission. |
CanManageFolder(FolderInfo)
Returns a flag indicating whether the current user can manage a folder's settings.
Declaration
public virtual bool CanManageFolder(FolderInfo folder)
Parameters
Type | Name | Description |
---|---|---|
FolderInfo | folder | The page. |
Returns
Type | Description |
---|---|
System.Boolean | A flag indicating whether the user has permission. |
CanManageModule(ModuleInfo)
Returns a flag indicating whether the current user can manage a module's settings.
Declaration
public virtual bool CanManageModule(ModuleInfo module)
Parameters
Type | Name | Description |
---|---|---|
ModuleInfo | module | The page. |
Returns
Type | Description |
---|---|
System.Boolean | A flag indicating whether the user has permission. |
CanManagePage(TabInfo)
Returns a flag indicating whether the current user can manage a page's settings.
Declaration
public virtual bool CanManagePage(TabInfo tab)
Parameters
Type | Name | Description |
---|---|---|
TabInfo | tab | The page. |
Returns
Type | Description |
---|---|
System.Boolean | A flag indicating whether the user has permission. |
CanNavigateToPage(TabInfo)
Returns a flag indicating whether the current user can see a page in a navigation object.
Declaration
public virtual bool CanNavigateToPage(TabInfo tab)
Parameters
Type | Name | Description |
---|---|---|
TabInfo | tab | The page. |
Returns
Type | Description |
---|---|
System.Boolean | A flag indicating whether the user has permission. |
CanViewFolder(FolderInfo)
Returns a flag indicating whether the current user can view a folder or file.
Declaration
public virtual bool CanViewFolder(FolderInfo folder)
Parameters
Type | Name | Description |
---|---|---|
FolderInfo | folder | The page. |
Returns
Type | Description |
---|---|
System.Boolean | A flag indicating whether the user has permission. |
CanViewModule(ModuleInfo)
Returns a flag indicating whether the current user can view a module.
Declaration
public virtual bool CanViewModule(ModuleInfo module)
Parameters
Type | Name | Description |
---|---|---|
ModuleInfo | module | The page. |
Returns
Type | Description |
---|---|
System.Boolean | A flag indicating whether the user has permission. |
CanViewPage(TabInfo)
Returns a flag indicating whether the current user can view a page.
Declaration
public virtual bool CanViewPage(TabInfo tab)
Parameters
Type | Name | Description |
---|---|---|
TabInfo | tab | The page. |
Returns
Type | Description |
---|---|
System.Boolean | A flag indicating whether the user has permission. |
DeleteFolderPermissionsByUser(UserInfo)
Declaration
public virtual void DeleteFolderPermissionsByUser(UserInfo objUser)
Parameters
Type | Name | Description |
---|---|---|
UserInfo | objUser |
DeleteModulePermissionsByUser(UserInfo)
DeleteModulePermissionsByUser deletes a user's Module Permission in the Database.
Declaration
public virtual void DeleteModulePermissionsByUser(UserInfo user)
Parameters
Type | Name | Description |
---|---|---|
UserInfo | user | The user. |
DeletePortalPermissionsByUser(UserInfo)
DeletePortalPermissionsByUser deletes a user's Portal Permissions in the Database.
Declaration
public virtual void DeletePortalPermissionsByUser(UserInfo user)
Parameters
Type | Name | Description |
---|---|---|
UserInfo | user | The user. |
DeleteTabPermissionsByUser(UserInfo)
DeleteTabPermissionsByUser deletes a user's Tab Permissions in the Database.
Declaration
public virtual void DeleteTabPermissionsByUser(UserInfo user)
Parameters
Type | Name | Description |
---|---|---|
UserInfo | user | The user. |
GetDesktopModulePermission(Int32)
GetDesktopModulePermission gets a DesktopModule Permission from the Database.
Declaration
public virtual DesktopModulePermissionInfo GetDesktopModulePermission(int desktopModulePermissionId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | desktopModulePermissionId | The ID of the DesktopModule Permission. |
Returns
Type | Description |
---|---|
DesktopModulePermissionInfo | A DesktopModulePermissionInfo or null. |
GetDesktopModulePermissions(Int32)
GetDesktopModulePermissions gets a DesktopModulePermissionCollection.
Declaration
public virtual DesktopModulePermissionCollection GetDesktopModulePermissions(int portalDesktopModuleId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalDesktopModuleId | The ID of the DesktopModule. |
Returns
Type | Description |
---|---|
DesktopModulePermissionCollection | A DesktopModulePermissionCollection with the desktop module permissions, or an empty DesktopModulePermissionCollection if the desktop module wasn't found. |
GetFolderPermissionsCollectionByFolder(Int32, String)
Declaration
public virtual FolderPermissionCollection GetFolderPermissionsCollectionByFolder(int portalID, string folder)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalID | |
System.String | folder |
Returns
Type | Description |
---|---|
FolderPermissionCollection |
GetModulePermissions(Int32, Int32)
GetModulePermissions gets a ModulePermissionCollection.
Declaration
public virtual ModulePermissionCollection GetModulePermissions(int moduleID, int tabID)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | moduleID | The ID of the module. |
System.Int32 | tabID | The ID of the tab. |
Returns
Type | Description |
---|---|
ModulePermissionCollection | A ModulePermissionCollection with the module permissions, or an empty ModulePermissionCollection if the module wasn't found. |
GetPortalPermissions(Int32)
GetPortalPermissions gets a PortalPermissionCollection.
Declaration
public virtual PortalPermissionCollection GetPortalPermissions(int portalId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | The ID of the portal. |
Returns
Type | Description |
---|---|
PortalPermissionCollection | A PortalPermissionCollection with the portal permissions, or an empty PortalPermissionCollection if the portal wasn't found. |
GetTabPermissions(Int32, Int32)
GetTabPermissions gets a TabPermissionCollection.
Declaration
public virtual TabPermissionCollection GetTabPermissions(int tabId, int portalId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | tabId | The ID of the tab. |
System.Int32 | portalId | The ID of the portal. |
Returns
Type | Description |
---|---|
TabPermissionCollection | A TabPermissionCollection instance with the tab's permissions, or an empty TabPermissionCollection if it can't be found. |
HasDesktopModulePermission(DesktopModulePermissionCollection, String)
HasDesktopModulePermission checks whether the current user has a specific DesktopModule Permission.
Declaration
public virtual bool HasDesktopModulePermission(DesktopModulePermissionCollection desktopModulePermissions, string permissionKey)
Parameters
Type | Name | Description |
---|---|---|
DesktopModulePermissionCollection | desktopModulePermissions | The Permissions for the DesktopModule. |
System.String | permissionKey | The Permission to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the current user has the requested permission, otherwise false. |
HasFolderPermission(FolderPermissionCollection, String)
Declaration
public virtual bool HasFolderPermission(FolderPermissionCollection objFolderPermissions, string permissionKey)
Parameters
Type | Name | Description |
---|---|---|
FolderPermissionCollection | objFolderPermissions | |
System.String | permissionKey |
Returns
Type | Description |
---|---|
System.Boolean |
HasModuleAccess(SecurityAccessLevel, String, ModuleInfo)
Determines if user has the necessary permissions to access an item with the designated AccessLevel.
Declaration
public virtual bool HasModuleAccess(SecurityAccessLevel accessLevel, string permissionKey, ModuleInfo moduleConfiguration)
Parameters
Type | Name | Description |
---|---|---|
SecurityAccessLevel | accessLevel | The SecurityAccessLevel required to access a portal module or module action. |
System.String | permissionKey | If Security Access is Edit the permissionKey is the actual "edit" permission required. |
ModuleInfo | moduleConfiguration | The ModuleInfo object for the associated module. |
Returns
Type | Description |
---|---|
System.Boolean | A boolean value indicating if the user has the necessary permissions. |
Remarks
Every module control and module action has an associated permission level. This function determines whether the user represented by UserName has sufficient permissions, as determined by the PortalSettings and ModuleSettings, to access a resource with the designated AccessLevel.
HasModulePermission(ModuleInfo, String)
Declaration
protected bool HasModulePermission(ModuleInfo moduleConfiguration, string permissionKey)
Parameters
Type | Name | Description |
---|---|---|
ModuleInfo | moduleConfiguration | |
System.String | permissionKey |
Returns
Type | Description |
---|---|
System.Boolean |
HasModulePermission(ModulePermissionCollection, String)
HasModulePermission checks whether the current user has a specific Module Permission.
Declaration
public virtual bool HasModulePermission(ModulePermissionCollection modulePermissions, string permissionKey)
Parameters
Type | Name | Description |
---|---|---|
ModulePermissionCollection | modulePermissions | The Permissions for the Module. |
System.String | permissionKey | The Permission to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the current user has the requested permission, otherwise false. |
HasPortalPermission(PortalPermissionCollection, String)
HasPortalPermission checks whether the current user has a specific Portal Permission.
Declaration
public virtual bool HasPortalPermission(PortalPermissionCollection portalPermissions, string permissionKey)
Parameters
Type | Name | Description |
---|---|---|
PortalPermissionCollection | portalPermissions | The Permissions for the Portal. |
System.String | permissionKey | The Permission to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the current user has the requested permission, otherwise false. |
HasTabPermission(TabPermissionCollection, String)
HasTabPermission checks whether the current user has a specific Tab Permission.
Declaration
public virtual bool HasTabPermission(TabPermissionCollection tabPermissions, string permissionKey)
Parameters
Type | Name | Description |
---|---|---|
TabPermissionCollection | tabPermissions | The Permissions for the Tab. |
System.String | permissionKey | The Permission to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the current user has the requested permission, otherwise false. |
ImplicitRolesForFolders(Int32)
Returns a list with all roles with implicit permissions on Folders.
Declaration
public virtual IEnumerable<RoleInfo> ImplicitRolesForFolders(int portalId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | The Portal Id where the permissions are. |
Returns
Type | Description |
---|---|
IEnumerable<RoleInfo> | A List with the implicit roles. |
ImplicitRolesForPages(Int32)
Returns a list with all roles with implicit permissions on Tabs.
Declaration
public virtual IEnumerable<RoleInfo> ImplicitRolesForPages(int portalId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | The Portal Id where the Roles are. |
Returns
Type | Description |
---|---|
IEnumerable<RoleInfo> | A List with the implicit roles. |
Instance()
Declaration
public static PermissionProvider Instance()
Returns
Type | Description |
---|---|
PermissionProvider |
IsDeniedModulePermission(ModuleInfo, String)
Declaration
protected bool IsDeniedModulePermission(ModuleInfo moduleConfiguration, string permissionKey)
Parameters
Type | Name | Description |
---|---|---|
ModuleInfo | moduleConfiguration | |
System.String | permissionKey |
Returns
Type | Description |
---|---|
System.Boolean |
IsDeniedTabPermission(TabInfo, String)
Declaration
protected bool IsDeniedTabPermission(TabInfo tab, string permissionKey)
Parameters
Type | Name | Description |
---|---|---|
TabInfo | tab | |
System.String | permissionKey |
Returns
Type | Description |
---|---|
System.Boolean |
IsPageAdmin(Int32)
Returns a flag indicating whether the current user is a page admin.
Declaration
public virtual bool IsPageAdmin(int portalId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | The id of the portal. |
Returns
Type | Description |
---|---|
System.Boolean | A flag indicating whether the user has permission. |
IsPortalEditor()
The portal editor can edit whole site's content, it should be only administrators by default.
Declaration
public virtual bool IsPortalEditor()
Returns
Type | Description |
---|---|
System.Boolean | true if the current user is in the administrator role for the current portal, otherwise false. |
SaveFolderPermissions(FolderInfo)
SaveFolderPermissions updates a Folder's permissions.
Declaration
public virtual void SaveFolderPermissions(FolderInfo folder)
Parameters
Type | Name | Description |
---|---|---|
FolderInfo | folder | The Folder to update. |
SaveFolderPermissions(IFolderInfo)
SaveFolderPermissions updates a Folder's permissions.
Declaration
public virtual void SaveFolderPermissions(IFolderInfo folder)
Parameters
Type | Name | Description |
---|---|---|
IFolderInfo | folder | The Folder to update. |
SaveModulePermissions(ModuleInfo)
SaveModulePermissions updates a Module's permissions.
Declaration
public virtual void SaveModulePermissions(ModuleInfo module)
Parameters
Type | Name | Description |
---|---|---|
ModuleInfo | module | The Module to update. |
SavePortalPermissions(PortalInfo)
SavePortalPermissions saves a Portal's permissions.
Declaration
public virtual void SavePortalPermissions(PortalInfo portal)
Parameters
Type | Name | Description |
---|---|---|
PortalInfo | portal | The Portal to update. |
SaveTabPermissions(TabInfo)
SaveTabPermissions saves a Tab's permissions.
Declaration
public virtual void SaveTabPermissions(TabInfo tab)
Parameters
Type | Name | Description |
---|---|---|
TabInfo | tab | The Tab to update. |
SupportsFullControl()
Declaration
public virtual bool SupportsFullControl()
Returns
Type | Description |
---|---|
System.Boolean |