TabPermissionController permissionController = new TabPermissionController(); bool canAdmin = permissionController.CanAdminPage(currentUser, tabPage); if (canAdmin) { // Allow user to edit tab content }
var permissionController = new TabPermissionController(); var editPermissions = permissionController.GetTabPermissionCollection(tabPage, "EDIT"); var canEdit = editPermissions.Contains(currentUser.UserID); if (canEdit) { // Allow user to edit tab content }In this example, we use the GetTabPermissionCollection method to retrieve the collection of permissions for the tabPage with a specific permission name ("EDIT"). We then check if the current user's UserID is contained within that collection, which would indicate that they have permission to edit the tab content. Package/Library: DotNetNuke (DNN) Library.