Added checks for existing permissions when creating, updating and deleting permissions.
This commit is contained in:
@@ -31,6 +31,11 @@ namespace HermesSocketServer.Requests
|
||||
Allow = allow,
|
||||
};
|
||||
|
||||
if (!channel.GroupPermissions.Get().Values.Any(p => p.GroupId == groupId && p.Path == path))
|
||||
{
|
||||
return Task.FromResult(RequestResult.Failed("Permission does not exist."));
|
||||
}
|
||||
|
||||
bool result = channel.GroupPermissions.Modify(id.ToString(), permission);
|
||||
if (result)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user