Security Action don't appear in the ConfigApiClient Sample

Hello,

I develloped some plugins in which I defined several SecurityActions.

I can access these in the server management client but they don’t appear in the ConfigApiClient sample.

So I just wanted to know if it’s possible to make them appear.

Edit : I add the permissions to the properties of each role, so now they appear in the sample but now I can’t set their value in the management client.

Are you using basic user? If so, can you please try with admin user? I tested with admin user then I was able to see permissions via ConfigApi Client.

Thank you for your answer.

I tried with a Window user with Admin rights.

The only way I managed to make my custom security actions appear is by adding them to the property list of the role. But in that case I cannot modify their value.

Maybe the issue come from the way I create my security actions ?

What is the XProtect product and version you are testing with?

I’m testing with Xprotect Essential + 2020 R1

Can you please share the code where you use the _securityActions member?

 public override void Init()
        {
            //Ajout des permissions
            _securityActions.Add(new SecurityAction("ViewAlerts", "Voir les alertes dans la liste"));
            _securityActions.Add(new SecurityAction("ViewAlarms", "Voir les alarmes dans la liste"));
 
            // Populate all relevant lists with your plugins etc.
            _itemNodes.Add(new ItemNode(TimelineKind, Guid.Empty,
                                         "Timeline", _treeNodeImage,
                                         "Timelines", _treeNodeImage,
                                         Category.Text, true,
                                         ItemsAllowed.Many,
                                         new TimelineItemManager(TimelineKind),
                                         null
                                         ));
 
            if (EnvironmentManager.Instance.EnvironmentType == EnvironmentType.SmartClient)
            {
                _sidePanelPlugins.Add(new TimelineSidePanelPlugin());
                _viewItemPlugins.Add(new TimelineViewItemPlugin());
                _settingsPanelPlugins.Add(new TimelineSettingsPanelPlugin());
            }
            if (EnvironmentManager.Instance.EnvironmentType == EnvironmentType.Administration)
            {
                _tabPlugins.Add(new TimelineTabPlugin());
                _toolsOptionsDialogPlugins.Add(new TimelineToolsOptionDialogPlugin());
            }
 
            _backgroundPlugins.Add(new TimelineBackgroundPlugin());
        }

I am sorry, but I still don’t see how the security actions are used. You add them to a member called _securityActions, but where do you use this? Normally the security actions are applied to the property SecurityActions on the ItemNode. Please see the SensorMonitor sample for an example of this: https://doc.developer.milestonesys.com/html/index.html?base=samples/sensormonitor_sample.html&tree=tree_1.html

But now how do i check if the role has these actions ?

I can’t use checkPermission because these properties are in Timelines and not TImeline.

_itemNodes = new List<ItemNode>
            {
                new ItemNode(TimelineKind, Guid.Empty,
                            "Timeline", _treeNodeImage,
                            "Timelines", _treeNodeImage,
                            Category.Text, true,
                            ItemsAllowed.Many,
                            new TimelineItemManager(TimelineKind),
                            null
                            )
                            {
                                SecurityActions = _securityActions
                            }
            };