public Boolean IsGrantedFor(Int64?accountId, String permission) { if (Actions.ContainsKey(permission)) { if (Required.TryGetValue(permission, out String? requiredPermission)) { permission = requiredPermission; } else { return(true); } } return(accountId is Int64 id && Permissions.ContainsKey(id) && Permissions[id].Contains(permission)); }