public static ItemPrivileges GetItemPrivileges(String _privileges) { ItemPrivileges itemPrivileges = new ItemPrivileges(); itemPrivileges.USER_NAME = ItemPrivilege.GetItemPrivilege(_privileges.Substring(0, 3)); itemPrivileges.Group = ItemPrivilege.GetItemPrivilege(_privileges.Substring(3, 3)); itemPrivileges.Others = ItemPrivilege.GetItemPrivilege(_privileges.Substring(6, 3)); return(itemPrivileges); }
public static ItemPrivilege GetItemPrivilege(String _privilege) { ItemPrivilege itemPrivilege = new ItemPrivilege(); // Read Permission if (_privilege[(Int32)PrivilegeAttribute.Read] == ReadPermission) itemPrivilege.Read = true; else itemPrivilege.Read = false; // Write Permission if (_privilege[(Int32)PrivilegeAttribute.Write] == WritePermission) itemPrivilege.Write = true; else itemPrivilege.Write = false; // Execute Permission if (_privilege[(Int32)PrivilegeAttribute.Execute] == ReadPermission) itemPrivilege.Execute = true; else itemPrivilege.Execute = false; return itemPrivilege; }
public static ItemPrivilege GetItemPrivilege(String _privilege) { ItemPrivilege itemPrivilege = new ItemPrivilege(); // Read Permission if (_privilege[(Int32)PrivilegeAttribute.Read] == ReadPermission) { itemPrivilege.Read = true; } else { itemPrivilege.Read = false; } // Write Permission if (_privilege[(Int32)PrivilegeAttribute.Write] == WritePermission) { itemPrivilege.Write = true; } else { itemPrivilege.Write = false; } // Execute Permission if (_privilege[(Int32)PrivilegeAttribute.Execute] == ReadPermission) { itemPrivilege.Execute = true; } else { itemPrivilege.Execute = false; } return(itemPrivilege); }