• Share
    • Twitter
    • LinkedIn
    • Facebook
    • Email
  • Feedback
  • Improve this Doc

Class ModulePermissionController

ModulePermissionController provides the Business Layer for Module Permissions.

Inheritance
System.Object
ModulePermissionController
Namespace: DotNetNuke.Security.Permissions
Assembly: DotNetNuke.dll
Syntax
public class ModulePermissionController : object

Methods

| Improve this Doc View Source

CanAdminModule(ModuleInfo)

Returns a flag indicating whether the current user can administer a module.

Declaration
public static 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.

| Improve this Doc View Source

CanDeleteModule(ModuleInfo)

Returns a flag indicating whether the current user can delete a module.

Declaration
public static 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.

| Improve this Doc View Source

CanEditModuleContent(ModuleInfo)

Returns a flag indicating whether the current user can edit module content.

Declaration
public static 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.

| Improve this Doc View Source

CanExportModule(ModuleInfo)

Returns a flag indicating whether the current user can export a module.

Declaration
public static 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.

| Improve this Doc View Source

CanImportModule(ModuleInfo)

Returns a flag indicating whether the current user can import a module.

Declaration
public static 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.

| Improve this Doc View Source

CanManageModule(ModuleInfo)

Returns a flag indicating whether the current user can manage a module's settings.

Declaration
public static 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.

| Improve this Doc View Source

CanViewModule(ModuleInfo)

Returns a flag indicating whether the current user can view a module.

Declaration
public static 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.

| Improve this Doc View Source

DeleteModulePermissionsByUser(UserInfo)

DeleteModulePermissionsByUser deletes a user's Module Permission in the Database.

Declaration
public static void DeleteModulePermissionsByUser(UserInfo user)
Parameters
Type Name Description
UserInfo user

The user.

| Improve this Doc View Source

GetModulePermissions(Int32, Int32)

GetModulePermissions gets a ModulePermissionCollection.

Declaration
public static 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.

| Improve this Doc View Source

HasModuleAccess(SecurityAccessLevel, String, ModuleInfo)

Determines if user has the necessary permissions to access an item with the designated AccessLevel.

Declaration
public static 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.

| Improve this Doc View Source

HasModulePermission(ModulePermissionCollection, String)

HasModulePermission checks whether the current user has a specific Module Permission.

Declaration
public static 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.

Remarks

If you pass in a comma delimited list of permissions (eg "ADD,DELETE", this will return true if the user has any one of the permissions.

| Improve this Doc View Source

ImplicitRoles(Int32)

Returns a list with all roles with implicit permissions on Modules.

Declaration
public static IEnumerable<RoleInfo> ImplicitRoles(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.

| Improve this Doc View Source

SaveModulePermissions(ModuleInfo)

SaveModulePermissions updates a Module's permissions.

Declaration
public static void SaveModulePermissions(ModuleInfo module)
Parameters
Type Name Description
ModuleInfo module

The Module to update.

Extension Methods

JsonExtensionsWeb.ToJson(Object)
  • View Source
Back to top by the community, for the community... #DNNCMS