OneIdentity / IdentityManager.Imx

HTML5 source code for Identity Manager web apps
Other
26 stars 107 forks source link

Only allow certain pilot user to use the new Angular Portal #151

Closed zime-rch closed 2 weeks ago

zime-rch commented 3 weeks ago

We try to figure out how we can limit the new Angular Portal to a small group of user by using a additional AERole or Systemuser. Is there a possibility to limit the new angular in this way? I did not found any configuration parameter.

hannoquest commented 3 weeks ago

Hi @zime-rch ,

There is an API sample to add access control to a specific app/API project.

You could use a program feature to control access.

using QBM.CompositionApi.Definition;
using QBM.CompositionApi.PlugIns;

namespace QBM.CompositionApi.Sdk01_Basics
{
    public class AccessControl : IApiProviderFor<PortalApiProject>
    {
        public void Build(IApiBuilder builder)
        {
            // Check for a specific program function (QBMFeature) at login time.
            // This example uses the "ApiServer_Admin" function.
            builder.AddPlugin(new CheckFeaturePlugin("ApiServer_Admin"));
        }
    }
}
zime-rch commented 3 weeks ago

Hi @hannoquest

I tried to build such a api but I am not sure what is the value for IApiProviderFor<??> (is it qer-app-portal ?)

using QBM.CompositionApi.Definition;
using QBM.CompositionApi.PlugIns;

namespace QBM.CompositionApi.AccessControlPilot
{
    public class AccessControl : IApiProviderFor<PortalApiProject>  
    {
        public void Build(IApiBuilder builder)
        {
            // Check for a specific program function (QBMFeature) at login time.
            // This example uses the "ApiServer_Admin" function.
            // Created a new feature in QBMFeature: Ident_DialogFeature = ApiServer_Pilot
            builder.AddPlugin(new CheckFeaturePlugin("ApiServer_Pilot"));
        }
    }

}
hannoquest commented 3 weeks ago

Hi @zime-rch ,

For the portal API project, use the interface IApiProviderFor<PortalApiProject>.

See also this section in the API development guide.

zime-rch commented 2 weeks ago

Hi @hannoquest

Thank you, I will follow the instruction in the manual.

zime-rch commented 2 weeks ago

Hi @hannoquest,

It has worked, issue will be closed:

image

zime-rch commented 2 weeks ago

closed