Class MenuPermissionController
Controls menu permissions.
Inherited Members
Namespace: Dnn.PersonaBar.Library.Permissions
Assembly: Dnn.PersonaBar.Library.dll
Syntax
public class MenuPermissionController
Constructors
MenuPermissionController()
Declaration
public MenuPermissionController()
Methods
CanView(IHostSettings, IPortalController, int, MenuItem)
Gets a value indicating whether the current user can view the specified menu.
Declaration
public static bool CanView(IHostSettings hostSettings, IPortalController portalController, int portalId, MenuItem menu)
Parameters
| Type | Name | Description |
|---|---|---|
| IHostSettings | hostSettings | The host settings. |
| IPortalController | portalController | The portal controller. |
| int | portalId | The portal ID. |
| MenuItem | menu | The menu. |
Returns
| Type | Description |
|---|---|
| bool |
CanView(IHostSettings, int, MenuItem)
Gets a value indicating whether the current user can view the specified menu.
Declaration
[Obsolete("Deprecated in DotNetNuke 10.2.4. Please use overload taking IPortalController. Scheduled for removal in v12.0.0.")]
public static bool CanView(IHostSettings hostSettings, int portalId, MenuItem menu)
Parameters
| Type | Name | Description |
|---|---|---|
| IHostSettings | hostSettings | The host settings. |
| int | portalId | The portal ID. |
| MenuItem | menu | The menu. |
Returns
| Type | Description |
|---|---|
| bool |
CanView(int, MenuItem)
Gets a value indicating whether the current user can view the specified menu.
Declaration
[Obsolete("Deprecated in DotNetNuke 10.2.2. Please use overload taking IHostSettings. Scheduled for removal in v12.0.0.")]
public static bool CanView(int portalId, MenuItem menu)
Parameters
| Type | Name | Description |
|---|---|---|
| int | portalId | The portal ID. |
| MenuItem | menu | The menu. |
Returns
| Type | Description |
|---|---|
| bool |
DeleteMenuPermissions(int, MenuItem)
Declaration
public static void DeleteMenuPermissions(int portalId, MenuItem menu)
Parameters
| Type | Name | Description |
|---|---|---|
| int | portalId | |
| MenuItem | menu |
DeletePersonaBarPermission(IHostSettings, int, string)
Deletes a menu permission.
Declaration
public static void DeletePersonaBarPermission(IHostSettings hostSettings, int menuId, string permissionKey)
Parameters
| Type | Name | Description |
|---|---|---|
| IHostSettings | hostSettings | The host settings. |
| int | menuId | The menu ID. |
| string | permissionKey | The permission key. |
DeletePersonaBarPermission(int, string)
Deletes a menu permission.
Declaration
[Obsolete("Deprecated in DotNetNuke 10.2.2. Please use overload with IHostSettings. Scheduled for removal in v12.0.0.")]
public static void DeletePersonaBarPermission(int menuId, string permissionKey)
Parameters
| Type | Name | Description |
|---|---|---|
| int | menuId | The menu ID. |
| string | permissionKey | The permission key. |
GetMenuPermissions(IHostSettings, IPortalController, int)
Gets the menu permissions.
Declaration
public static MenuPermissionCollection GetMenuPermissions(IHostSettings hostSettings, IPortalController portalController, int portalId)
Parameters
| Type | Name | Description |
|---|---|---|
| IHostSettings | hostSettings | The host settings. |
| IPortalController | portalController | The portal controller. |
| int | portalId | The portal ID. |
Returns
| Type | Description |
|---|---|
| MenuPermissionCollection |
GetMenuPermissions(IHostSettings, IPortalController, int, int)
Gets the menu permissions.
Declaration
public static MenuPermissionCollection GetMenuPermissions(IHostSettings hostSettings, IPortalController portalController, int portalId, int menuId)
Parameters
| Type | Name | Description |
|---|---|---|
| IHostSettings | hostSettings | The host settings. |
| IPortalController | portalController | The portal controller. |
| int | portalId | The portal ID. |
| int | menuId | The menu ID. |
Returns
| Type | Description |
|---|---|
| MenuPermissionCollection |
GetMenuPermissions(IHostSettings, IPortalController, int, string)
Gets the menu permissions.
Declaration
public static MenuPermissionCollection GetMenuPermissions(IHostSettings hostSettings, IPortalController portalController, int portalId, string identifier)
Parameters
| Type | Name | Description |
|---|---|---|
| IHostSettings | hostSettings | The host settings. |
| IPortalController | portalController | The portal controller. |
| int | portalId | The portal ID. |
| string | identifier | The menu identifier. |
Returns
| Type | Description |
|---|---|
| MenuPermissionCollection |
GetMenuPermissions(IHostSettings, int)
Gets the menu permissions.
Declaration
[Obsolete("Deprecated in DotNetNuke 10.2.4. Please use overload taking IPortalController. Scheduled for removal in v12.0.0.")]
public static MenuPermissionCollection GetMenuPermissions(IHostSettings hostSettings, int portalId)
Parameters
| Type | Name | Description |
|---|---|---|
| IHostSettings | hostSettings | The host settings. |
| int | portalId | The portal ID. |
Returns
| Type | Description |
|---|---|
| MenuPermissionCollection |
GetMenuPermissions(IHostSettings, int, int)
Gets the menu permissions.
Declaration
[Obsolete("Deprecated in DotNetNuke 10.2.4. Please use overload taking IPortalController. Scheduled for removal in v12.0.0.")]
public static MenuPermissionCollection GetMenuPermissions(IHostSettings hostSettings, int portalId, int menuId)
Parameters
| Type | Name | Description |
|---|---|---|
| IHostSettings | hostSettings | The host settings. |
| int | portalId | The portal ID. |
| int | menuId | The menu ID. |
Returns
| Type | Description |
|---|---|
| MenuPermissionCollection |
GetMenuPermissions(IHostSettings, int, string)
Gets the menu permissions.
Declaration
[Obsolete("Deprecated in DotNetNuke 10.2.4. Please use overload taking IPortalController. Scheduled for removal in v12.0.0.")]
public static MenuPermissionCollection GetMenuPermissions(IHostSettings hostSettings, int portalId, string identifier)
Parameters
| Type | Name | Description |
|---|---|---|
| IHostSettings | hostSettings | The host settings. |
| int | portalId | The portal ID. |
| string | identifier | The menu identifier. |
Returns
| Type | Description |
|---|---|
| MenuPermissionCollection |
GetMenuPermissions(int)
Gets the menu permissions.
Declaration
[Obsolete("Deprecated in DotNetNuke 10.2.2. Please use overload taking IHostSettings. Scheduled for removal in v12.0.0.")]
public static MenuPermissionCollection GetMenuPermissions(int portalId)
Parameters
| Type | Name | Description |
|---|---|---|
| int | portalId | The portal ID. |
Returns
| Type | Description |
|---|---|
| MenuPermissionCollection |
GetMenuPermissions(int, int)
Gets the menu permissions.
Declaration
[Obsolete("Deprecated in DotNetNuke 10.2.2. Please use overload taking IHostSettings. Scheduled for removal in v12.0.0.")]
public static MenuPermissionCollection GetMenuPermissions(int portalId, int menuId)
Parameters
| Type | Name | Description |
|---|---|---|
| int | portalId | The portal ID. |
| int | menuId | The menu ID. |
Returns
| Type | Description |
|---|---|
| MenuPermissionCollection |
GetMenuPermissions(int, string)
Gets the menu permissions.
Declaration
[Obsolete("Deprecated in DotNetNuke 10.2.2. Please use overload taking IHostSettings. Scheduled for removal in v12.0.0.")]
public static MenuPermissionCollection GetMenuPermissions(int portalId, string identifier)
Parameters
| Type | Name | Description |
|---|---|---|
| int | portalId | The portal ID. |
| string | identifier | The menu identifier. |
Returns
| Type | Description |
|---|---|
| MenuPermissionCollection |
GetPermissions(IHostSettings, int)
Gets the permissions for the menu.
Declaration
public static IList<PermissionInfo> GetPermissions(IHostSettings hostSettings, int menuId)
Parameters
| Type | Name | Description |
|---|---|---|
| IHostSettings | hostSettings | The host settings. |
| int | menuId | The menu ID. |
Returns
| Type | Description |
|---|---|
| IList<PermissionInfo> | A list of permissions. |
GetPermissions(int)
Gets the permissions for the menu.
Declaration
[Obsolete("Deprecated in DotNetNuke 10.2.2. Please use overload with IHostSettings. Scheduled for removal in v12.0.0.")]
public static IList<PermissionInfo> GetPermissions(int menuId)
Parameters
| Type | Name | Description |
|---|---|---|
| int | menuId | The menu ID. |
Returns
| Type | Description |
|---|---|
| IList<PermissionInfo> | A list of permissions. |
HasMenuPermission(MenuPermissionCollection, string)
Declaration
public static bool HasMenuPermission(MenuPermissionCollection menuPermissions, string permissionKey)
Parameters
| Type | Name | Description |
|---|---|---|
| MenuPermissionCollection | menuPermissions | |
| string | permissionKey |
Returns
| Type | Description |
|---|---|
| bool |
HasMenuPermission(IHostSettings, IPortalController, int, MenuItem, string)
Gets a value indicating whether the current user has the specified menu permission.
Declaration
public static bool HasMenuPermission(IHostSettings hostSettings, IPortalController portalController, int portalId, MenuItem menu, string permissionKey)
Parameters
| Type | Name | Description |
|---|---|---|
| IHostSettings | hostSettings | The host settings. |
| IPortalController | portalController | The portal controller. |
| int | portalId | The portal ID. |
| MenuItem | menu | The menu. |
| string | permissionKey | The permission key. |
Returns
| Type | Description |
|---|---|
| bool |
HasMenuPermission(IHostSettings, int, MenuItem, string)
Gets a value indicating whether the current user has the specified menu permission.
Declaration
[Obsolete("Deprecated in DotNetNuke 10.2.4. Please use overload taking IPortalController. Scheduled for removal in v12.0.0.")]
public static bool HasMenuPermission(IHostSettings hostSettings, int portalId, MenuItem menu, string permissionKey)
Parameters
| Type | Name | Description |
|---|---|---|
| IHostSettings | hostSettings | The host settings. |
| int | portalId | The portal ID. |
| MenuItem | menu | The menu. |
| string | permissionKey | The permission key. |
Returns
| Type | Description |
|---|---|
| bool |
HasMenuPermission(int, MenuItem, string)
Gets a value indicating whether the current user has the specified menu permission.
Declaration
[Obsolete("Deprecated in DotNetNuke 10.2.2. Please use overload taking IHostSettings. Scheduled for removal in v12.0.0.")]
public static bool HasMenuPermission(int portalId, MenuItem menu, string permissionKey)
Parameters
| Type | Name | Description |
|---|---|---|
| int | portalId | The portal ID. |
| MenuItem | menu | The menu. |
| string | permissionKey | The permission key. |
Returns
| Type | Description |
|---|---|
| bool |
PermissionAlreadyInitialized(int)
Declaration
public static bool PermissionAlreadyInitialized(int portalId)
Parameters
| Type | Name | Description |
|---|---|---|
| int | portalId |
Returns
| Type | Description |
|---|---|
| bool |
SaveMenuDefaultPermissions(IHostSettings, IPortalController, int, MenuItem, string)
Saves the menu's default permissions.
Declaration
public static void SaveMenuDefaultPermissions(IHostSettings hostSettings, IPortalController portalController, int portalId, MenuItem menuItem, string roleName)
Parameters
| Type | Name | Description |
|---|---|---|
| IHostSettings | hostSettings | The host settings. |
| IPortalController | portalController | The portal controller. |
| int | portalId | The portal ID. |
| MenuItem | menuItem | The menu item. |
| string | roleName | The role name. |
SaveMenuDefaultPermissions(IHostSettings, int, MenuItem, string)
Saves the menu's default permissions.
Declaration
[Obsolete("Deprecated in DotNetNuke 10.2.4. Please use overload taking IPortalController. Scheduled for removal in v12.0.0.")]
public static void SaveMenuDefaultPermissions(IHostSettings hostSettings, int portalId, MenuItem menuItem, string roleName)
Parameters
| Type | Name | Description |
|---|---|---|
| IHostSettings | hostSettings | The host settings. |
| int | portalId | The portal ID. |
| MenuItem | menuItem | The menu item. |
| string | roleName | The role name. |
SaveMenuDefaultPermissions(int, MenuItem, string)
Saves the menu's default permissions.
Declaration
[Obsolete("Deprecated in DotNetNuke 10.2.2. Please use overload taking IHostSettings. Scheduled for removal in v12.0.0.")]
public static void SaveMenuDefaultPermissions(int portalId, MenuItem menuItem, string roleName)
Parameters
| Type | Name | Description |
|---|---|---|
| int | portalId | The portal ID. |
| MenuItem | menuItem | The menu item. |
| string | roleName | The role name. |
SaveMenuPermissions(int, MenuItem, MenuPermissionInfo)
Declaration
public static void SaveMenuPermissions(int portalId, MenuItem menu, MenuPermissionInfo permissionInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| int | portalId | |
| MenuItem | menu | |
| MenuPermissionInfo | permissionInfo |
SavePersonaBarPermission(int, string, string)
Declaration
public static void SavePersonaBarPermission(int menuId, string permissionKey, string permissionName)
Parameters
| Type | Name | Description |
|---|---|---|
| int | menuId | |
| string | permissionKey | |
| string | permissionName |
SavePersonaBarPermission(string, string, string)
Declaration
public static void SavePersonaBarPermission(string menuIdentifier, string permissionKey, string permissionName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | menuIdentifier | |
| string | permissionKey | |
| string | permissionName |