Fixed compiler warnings.
This commit is contained in:
@@ -14,18 +14,18 @@ namespace HermesSocketServer.Requests
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public async Task<RequestResult> Grant(Channel channel, IDictionary<string, object> data)
|
||||
public Task<RequestResult> Grant(Channel channel, IDictionary<string, object> data)
|
||||
{
|
||||
string policyId = data["id"].ToString()!;
|
||||
var policy = channel.Policies.Get(policyId);
|
||||
if (policy != null) {
|
||||
channel.Policies.Remove(policyId);
|
||||
_logger.Information($"Deleted a policy by id [policy id: {data["id"]}]");
|
||||
return RequestResult.Successful(policy.GroupId + "/" + policy.Path);
|
||||
return Task.FromResult(RequestResult.Successful(policy.GroupId + "/" + policy.Path));
|
||||
}
|
||||
|
||||
_logger.Warning("Failed to find policy by id ");
|
||||
return RequestResult.Failed("Cannot find the policy by id.");
|
||||
_logger.Warning($"Failed to find policy by id [id: {policyId}]");
|
||||
return Task.FromResult(RequestResult.Failed("Cannot find the policy by id."));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user