hello Antoine,
Antoine de Torcy wrote:
> Hi Tony,
>
> There might be several ways to implement this with rules and microservices. Here is one example, made very simple thanks to the new rule language's syntax. I have defined two rules: one that queries the iCAT to test if a given username is that of an admin, and a modification of acPreProcForModifyAccessControl that aborts the operation if a non-admin user tries to modify access control for an admin. To enable these rules just add
custom.re to your iRODS/server/config/reConfigs/ directory and edit your iRODS/server/config/server.config to list the additional rule definition file: 'reRuleSet custom,core' in this order, comma separated (without spaces I believe). No need to rebuild or restart your iRODS server here.
>
> You may notice that had to I use cut and fail to abort the operation, and that the error message returned by the client (at least with ichmod) looks more like debugging info than a "not enough privilege" message you would expect here.
there is already a msiExit msi which allows to put a message of your
choice in the error stack. However, this error stack was not printed out
for almost all the icommands. I have added this into almost all the
icommands a month ago, so it will available in the next release. Hence
admins will be able to pass to the client a customized error message of
their own.
cheers,
JY
> This could possibly be refined in future updates to the rule engine, as per Hao's comments.
>
> Feel free to give this a shot a see if it works for you.
> Cheers,
>
> AdT
>
>
>
>