public bool isAllowed(int pid, string fullpath, UserOwner user, GroupOwner[] usergroups) { return(isTrustedPid(pid) || isUserTrusted(user) || isGroupsTrusted(usergroups) || isProcessPathAllowed(fullpath, user, usergroups)); }
public bool isUserTrusted(UserOwner user) { bool foundAllowed = false; if (__trustedUsersSearch[user.Type].Contains(user.Value)) { foundAllowed = true; } return(foundAllowed); }
public bool isProcessPathAllowed(string fullpath, UserOwner user, GroupOwner[] usergroups) { string myPath = PathPolicy.makeStandartPath(fullpath); bool allowed = false; if (!__allowedPathSearch.ContainsKey(myPath)) { allowed = false; } else { if (__allowedPathSearch[myPath].PathFilter == PathAllowedType.ANY) { allowed = true; } else { if (!allowed) { allowed = __allowedPathSearch[myPath].AllowedUsers.Contains(user); } if (!allowed) { foreach (var item in usergroups) { if (__allowedPathSearch[myPath].AllowedGroups.Contains(item)) { allowed = true; break; } } } } } if (PolicyMode == FilterMode.Blacklist) { allowed = !allowed; } return(allowed); }
public override bool Equals(object obj) { UserOwner other = obj as UserOwner; return(other != null && other.Type == Type && other.Value == Value); }