improvements for custom authorization policy usage

This commit is contained in:
Shaun Walker
2020-06-25 10:23:27 -04:00
parent a4a0334ec0
commit 6e7c8e7b05
5 changed files with 42 additions and 14 deletions

View File

@ -170,6 +170,19 @@ namespace Oqtane.Services
// can be used to override the default alias
public Alias Alias { get; set; }
// add entityid parameter to url for custom authorization policy
public string CreateAuthorizationPolicyUrl(string url, int entityId)
{
if (url.Contains("?"))
{
return url + "&entityid=" + entityId.ToString();
}
else
{
return url + "?entityid=" + entityId.ToString();
}
}
[Obsolete("This method is obsolete. Use CreateApiUrl(Alias alias, string serviceName) instead.", false)]
public string CreateApiUrl(Alias alias, string absoluteUri, string serviceName)
{