PermissionGetPermission Method | |
Gives permissions by User and Module
Namespace:
SOWIApp.Management.Data
Assembly:
SOWIApp.Management (in SOWIApp.Management.dll) Version: 19.1.23.1 (19.1.23.622)
Syntax public List<PermissionSimple> GetPermission(
string pUserName,
string pModuleName
)
Public Function GetPermission (
pUserName As String,
pModuleName As String
) As List(Of PermissionSimple)
Parameters
- pUserName
- Type: SystemString
[Missing <param name="pUserName"/> documentation for "M:SOWIApp.Management.Data.Permission.GetPermission(System.String,System.String)"]
- pModuleName
- Type: SystemString
[Missing <param name="pModuleName"/> documentation for "M:SOWIApp.Management.Data.Permission.GetPermission(System.String,System.String)"]
Return Value
Type:
ListPermissionSimplelist based by SOWIData.Management.PermissionsSimple
Remarks
Database relationship:
------ ---------- ------------ --------
| User |-->| UserRole |-->| Permission |<--| Module |
------ ---------- ------------ --------
Examples
SQL statement:
--Permissions by User and Module
SELECT Permission.ID AS PermissionID, [User].ID AS UserID, UserRole.StatusText, Module.Name AS ModuleName, Permission.CanCreate, Permission.CanRead, Permission.CanReadOwner,
Permission.CanUpdate, Permission.CanUpdateOwner,
Permission.CanDelete, Permission.CanDeleteOwner, Permission.StatusText, [User].Name AS UserName
FROM[User] LEFT OUTER JOIN
UserRole ON[User].ID = UserRole.UserID LEFT OUTER JOIN
Module LEFT OUTER JOIN
Permission ON Module.ID = Permission.ModuleID ON UserRole.RoleID = Permission.RoleID
WHERE(Module.Name = N'Ticket') AND([User].Name = N'Elektriker')
AND(NOT (UserRole.StatusText = N'Delete')) AND(NOT (Permission.StatusText = N'Delete'))
Result:
ModuleName CanCreate CanRead CanReadOwner CanUpdate CanUpdateOwner CanDelete CanDeleteOwner StatusText UserName
Activity 1 1 1 1 1 1 1 Insert Franz01
See Also