Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Looking up a user's group membership from a rule
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  11 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Tony Edgin  
View profile   Translate to Translated (View Original)
 More options Jun 27 2012, 6:05 pm
From: Tony Edgin <tedgin.ipl...@gmail.com>
Date: Wed, 27 Jun 2012 15:05:38 -0700
Local: Wed, Jun 27 2012 6:05 pm
Subject: Looking up a user's group membership from a rule

Hi everyone.

Using the acPreProcForModifyAccessControl rule, I'm trying to prevent a
user from changing the ACL for any other user belonging to the rodsadmin
group.  I can't seem to find a microservice that provides group membership
information for a given user.  Is there such a microservice?

Thanks in advance.
Tony


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jean-Yves Nief  
View profile   Translate to Translated (View Original)
 More options Jun 28 2012, 4:59 am
From: Jean-Yves Nief <n...@cc.in2p3.fr>
Date: Thu, 28 Jun 2012 10:59:03 +0200
Local: Thurs, Jun 28 2012 4:59 am
Subject: Re: [iROD-Chat:8294] Looking up a user's group membership from a rule
hello,

             there is no such microservice. However, you can query the
database to find the information using msiMakeGenQuery:
clients/icommands/test/rules3.0/rulemsiExecGenQuery.r
the attributes you should work with in your case, should be USER_TYPE.
hope this help,
JY


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Antoine de Torcy  
View profile  
 More options Jul 4 2012, 1:18 pm
From: Antoine de Torcy <adeto...@email.unc.edu>
Date: Wed, 4 Jul 2012 13:18:20 -0400
Local: Wed, Jul 4 2012 1:18 pm
Subject: Re: [iROD-Chat:8296] Looking up a user's group membership from a rule

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. 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

  custom.re
< 1K Download

On Jun 28, 2012, at 4:59 AM, Jean-Yves Nief wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Reagan Moore  
View profile  
 More options Jul 5 2012, 9:38 am
From: Reagan Moore <rwmo...@renci.org>
Date: Thu, 5 Jul 2012 13:38:13 +0000
Local: Thurs, Jul 5 2012 9:38 am
Subject: Re: [iROD-Chat:8305] Looking up a user's group membership from a rule

Antoine:
In the acIsRodsAdmin the last operation is the conversion of a string to a boolean value.

I did not see how the execution of acIsRodsAdmin is associated with the boolean value.

Reagan

From: Antoine de Torcy <adeto...@email.unc.edu<mailto:adeto...@email.unc.edu>>
Reply-To: "irod-chat@googlegroups.com<mailto:irod-chat@googlegroups.com>" <irod-chat@googlegroups.com<mailto:irod-chat@googlegroups.com>>
Date: Wednesday, July 4, 2012 1:18 PM
To: "irod-chat@googlegroups.com<mailto:irod-chat@googlegroups.com>" <irod-chat@googlegroups.com<mailto:irod-chat@googlegroups.com>>
Cc: Tony Edgin <tedgin.ipl...@gmail.com<mailto:tedgin.ipl...@gmail.com>>
Subject: Re: [iROD-Chat:8305] Looking up a user's group membership from a rule

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. 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

--
"iRODS: the Integrated Rule-Oriented Data-management System; A community driven, open source, data grid software solution"   https://www.irods.org

 iROD-Chat:  http://groups.google.com/group/iROD-Chat


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Antoine de Torcy  
View profile  
 More options Jul 5 2012, 11:14 am
From: Antoine de Torcy <adeto...@email.unc.edu>
Date: Thu, 5 Jul 2012 08:14:12 -0700
Local: Thurs, Jul 5 2012 11:14 am
Subject: Re: [iROD-Chat:8307] Looking up a user's group membership from a rule
Reagan:

By having bool(*isAdmin); as the last instruction in acIsRodsAdmin it not only does the conversion but also makes the resulting boolean acIsRodsAdmin's return value. This allows to use acIsRodsAdmin(*UserName) directly as a condition. I learnt that trick from Hao. The previous version of acIsRodsAdmin contained:
if (*isAdmin) { succeed; } else {fail; }
And would be used like this:
acPreProcForModifyAccessControl(...) { on (acIsRodsAdmin(*UserName) >= 0) { ... } }

Antoine

On Jul 5, 2012, at 6:38 AM, Reagan Moore wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jean-Yves Nief  
View profile  
 More options Jul 5 2012, 11:32 am
From: Jean-Yves Nief <n...@cc.in2p3.fr>
Date: Thu, 05 Jul 2012 17:32:38 +0200
Local: Thurs, Jul 5 2012 11:32 am
Subject: Re: [iROD-Chat:8305] Looking up a user's group membership from a rule
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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Antoine de Torcy  
View profile  
 More options Jul 5 2012, 2:18 pm
From: Antoine de Torcy <adeto...@email.unc.edu>
Date: Thu, 5 Jul 2012 11:18:54 -0700
Local: Thurs, Jul 5 2012 2:18 pm
Subject: Re: [iROD-Chat:8309] Looking up a user's group membership from a rule

Thanks Jean-Yves. In a quick test I am getting the same behavior here with msiExit instead of fail, and it's a bit cleaner.

AdT

  custom.re
< 1K Download

On Jul 5, 2012, at 8:32 AM, Jean-Yves Nief wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tony Edgin  
View profile  
 More options Jul 9 2012, 3:29 pm
From: Tony Edgin <tedgin.ipl...@gmail.com>
Date: Mon, 9 Jul 2012 12:29:54 -0700
Local: Mon, Jul 9 2012 3:29 pm
Subject: Re: [iROD-Chat:8310] Looking up a user's group membership from a rule

Thanks guys.

I've noticed if instead of the cut, msiExit combination, an error code is
used, the error message on the client's command line looks better.  For
instance.

acPreProcForModifyAccessControl(*RecursiveFlag,*AccessLevel,*UserName,*Zone ,*Path)
{
    on (acIsRodsAdmin(*UserName) && !acIsRodsAdmin($userNameClient)) {
#        cut;
#        msiExit("-830000","Operation not permitted");
        -830000;
    }

}

Is this an allowed form, or am I taking advantage of looseness in the rule
parser?

I would only use this form until msiExit is supported by the other
icommands.

Cheers,
Tony

On Thu, Jul 5, 2012 at 11:18 AM, Antoine de Torcy <adeto...@email.unc.edu>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Hao Xu  
View profile  
 More options Jul 11 2012, 3:49 pm
From: Hao Xu <x...@cs.unc.edu>
Date: Wed, 11 Jul 2012 15:49:26 -0400
Local: Wed, Jul 11 2012 3:49 pm
Subject: Re: [iROD-Chat:8327] Looking up a user's group membership from a rule

Hi Tony,

In this form where the rule has a negative integer as its last action, the
rule engine actually thinks the rule as being successful. The reason that
it works is probably because of the particular way this event hook (and
some other event hooks) is handled by the rule engine and related code.
Therefore, it is not encouraged to used this approach as a general method
for representing a failure. I think it is ok if it works for you in this
particular event hook, but I would use the cut/msiExit combination
(alternatively you can use cut/fail combination, but you still get the
generic "cut error"), as it tells the rule engine that the rule actually
fails. (Thanks Jean-Yves for patching the icommands!)

In future release we can enhance the cut microservice to do more, such as
allowing customised error code and error messages.

  Hao


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tony Edgin  
View profile   Translate to Translated (View Original)
 More options Jul 11 2012, 8:35 pm
From: Tony Edgin <tedgin.ipl...@gmail.com>
Date: Wed, 11 Jul 2012 17:35:02 -0700
Local: Wed, Jul 11 2012 8:35 pm
Subject: Re: [iROD-Chat:8336] Looking up a user's group membership from a rule

Thanks Hao.  I'll switch over to cut/msiExit on 3.2 is released.

Back to my original question.  Using the USER_TYPE field solves the problem
I stated, but I had simplified my problem a bit.

We use groups to distinguish two classes of users with administrator type
users.  One group just has ownership of everything.  This group of
privileged users is not allowed to remove another privileged user's
ownership of an object.  The second group of users are allowed unfettered
ability to to change an object's ACL.  Because of these two groups, we
can't use type to distinguish admin users from normal.

Looking over the allowed fields in a general query, there doesn't appear to
be any sort of mapping from user to group, so it appears a general query
cannot be used to find the set of users in a group.  Did I miss something?

Cheers,
Tony


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Conway, Mike  
View profile  
 More options Jul 12 2012, 6:55 am
From: "Conway, Mike" <michael_con...@unc.edu>
Date: Thu, 12 Jul 2012 10:55:06 +0000
Local: Thurs, Jul 12 2012 6:55 am
Subject: Re: [iROD-Chat:8337] Looking up a user's group membership from a rule

Hi Tony, here's how Jargon's UserGroup service lists users in a given group

select USER_ZONE,USER_NAME,USER_ID,USER_TYPE,USER_INFO,USER_COMMENT,USER_CREATE_TI ME,USER_MODIFY_TIME,USER_GROUP_NAME where USER_GROUP_NAME = 'testListUserGroupMembersGroupExists'

GenQuery will compute the joins for you based on the selects, which can be tricky at times!

MC

---------------------
Mike Conway
Interface and Java API/Integration Developer  – DICE
www.irods.org

skype:michael.c.conway
LinkedIn: http://www.linkedin.com/pub/mike-conway/5/78a/231

From: Tony Edgin <tedgin.ipl...@gmail.com<mailto:tedgin.ipl...@gmail.com>>
Reply-To: <irod-chat@googlegroups.com<mailto:irod-chat@googlegroups.com>>
Date: Wed, 11 Jul 2012 17:35:02 -0700
To: <irod-chat@googlegroups.com<mailto:irod-chat@googlegroups.com>>
Subject: Re: [iROD-Chat:8337] Looking up a user's group membership from a rule

Thanks Hao.  I'll switch over to cut/msiExit on 3.2 is released.

Back to my original question.  Using the USER_TYPE field solves the problem I stated, but I had simplified my problem a bit.

We use groups to distinguish two classes of users with administrator type users.  One group just has ownership of everything.  This group of privileged users is not allowed to remove another privileged user's ownership of an object.  The second group of users are allowed unfettered ability to to change an object's ACL.  Because of these two groups, we can't use type to distinguish admin users from normal.

Looking over the allowed fields in a general query, there doesn't appear to be any sort of mapping from user to group, so it appears a general query cannot be used to find the set of users in a group.  Did I miss something?

Cheers,
Tony

On Wed, Jul 11, 2012 at 12:49 PM, Hao Xu <x...@cs.unc.edu<mailto:x...@cs.unc.edu>> wrote:

Hi Tony,

In this form where the rule has a negative integer as its last action, the rule engine actually thinks the rule as being successful. The reason that it works is probably because of the particular way this event hook (and some other event hooks) is handled by the rule engine and related code. Therefore, it is not encouraged to used this approach as a general method for representing a failure. I think it is ok if it works for you in this particular event hook, but I would use the cut/msiExit combination (alternatively you can use cut/fail combination, but you still get the generic "cut error"), as it tells the rule engine that the rule actually fails. (Thanks Jean-Yves for patching the icommands!)

In future release we can enhance the cut microservice to do more, such as allowing customised error code and error messages.

  Hao

On Mon, Jul 9, 2012 at 3:29 PM, Tony Edgin <tedgin.ipl...@gmail.com<mailto:tedgin.ipl...@gmail.com>> wrote:
Thanks guys.

I've noticed if instead of the cut, msiExit combination, an error code is used, the error message on the client's command line looks better.  For instance.

acPreProcForModifyAccessControl(*RecursiveFlag,*AccessLevel,*UserName,*Zone ,*Path) {
    on (acIsRodsAdmin(*UserName) && !acIsRodsAdmin($userNameClient)) {
#        cut;
#        msiExit("-830000","Operation not permitted");
        -830000;
    }

}

Is this an allowed form, or am I taking advantage of looseness in the rule parser?

I would only use this form until msiExit is supported by the other icommands.

Cheers,
Tony

On Thu, Jul 5, 2012 at 11:18 AM, Antoine de Torcy <adeto...@email.unc.edu<mailto:adeto...@email.unc.edu>> wrote:
Thanks Jean-Yves. In a quick test I am getting the same behavior here with msiExit instead of fail, and it's a bit cleaner.

AdT

On Jul 5, 2012, at 8:32 AM, Jean-Yves Nief wrote:

--
"iRODS: the Integrated Rule-Oriented Data-management System; A community driven, open source, data grid software solution"   https://www.irods.org

 iROD-Chat:  http://groups.google.com/group/iROD-Chat

--
"iRODS: the Integrated Rule-Oriented Data-management System; A community driven, open source, data grid software solution" https://www.irods.org

iROD-Chat: http://groups.google.com/group/iROD-Chat

--
"iRODS: the Integrated Rule-Oriented Data-management System; A community driven, open source, data grid software solution" https://www.irods.org

iROD-Chat: http://groups.google.com/group/iROD-Chat

--
"iRODS: the Integrated Rule-Oriented Data-management System; A community driven, open source, data grid software solution" https://www.irods.org

iROD-Chat: http://groups.google.com/group/iROD-Chat


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »