Class PortalPermissionController
PortalPermissionController provides the Business Layer for Portal Permissions.
Inheritance
Namespace: DotNetNuke.Security.Permissions
Assembly: DotNetNuke.dll
Syntax
public class PortalPermissionController : object
Methods
| Improve this Doc View SourceCanAddTopLevel()
Returns a flag indicating whether the current user can add top level pages on the current portal.
Declaration
public static bool CanAddTopLevel()
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 on a portal.
Declaration
public static bool CanAddTopLevel(int portalId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | The portal id. |
Returns
Type | Description |
---|---|
System.Boolean | A flag indicating whether the user has permission. |
CanAdminPages()
Returns a flag indicating whether the current user is a page admin for the current portal.
Declaration
public static bool CanAdminPages()
Returns
Type | Description |
---|---|
System.Boolean | A flag indicating whether the user has permission. |
CanAdminPages(Int32)
Returns a flag indicating whether the current user is a page admin for a portal.
Declaration
public static bool CanAdminPages(int portalId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | The portal id. |
Returns
Type | Description |
---|---|
System.Boolean | A flag indicating whether the user has permission. |
DeletePortalPermissionsByUser(UserInfo)
DeletePortalPermissionsByUser deletes a user's Portal Permissions in the Database.
Declaration
public static void DeletePortalPermissionsByUser(UserInfo user)
Parameters
Type | Name | Description |
---|---|---|
UserInfo | user | The user. |
GetPortalPermissions(Int32)
GetPortalPermissions gets a PortalPermissionCollection.
Declaration
public static 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. |
HasPortalPermission(PortalPermissionCollection, String)
HasPortalPermission checks whether the current user has a specific Portal Permission.
Declaration
public static bool HasPortalPermission(PortalPermissionCollection portalPermissions, string permissionKey)
Parameters
Type | Name | Description |
---|---|---|
PortalPermissionCollection | portalPermissions | The Permissions for the Portal. |
System.String | permissionKey | The Permission(s) 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.
HasPortalPermission(String)
HasPortalPermission checks whether the current user has a specific Portal Permission.
Declaration
public static bool HasPortalPermission(string permissionKey)
Parameters
Type | Name | Description |
---|---|---|
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.
SavePortalPermissions(PortalInfo)
SavePortalPermissions saves a Portal's permissions.
Declaration
public static void SavePortalPermissions(PortalInfo portal)
Parameters
Type | Name | Description |
---|---|---|
PortalInfo | portal | The Portal to update. |