Follow-up rules & conditions

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
Elmar
Posts: 62
Joined: Tue Mar 06, 2007 12:19 pm

Follow-up rules & conditions

Post by Elmar »

Hi there.

I wanted to implement a condition for an attribute where the current user can only edit self-created content. Naturally I tried to do add the following condition to the show edit and show delete function.

Activity.Member = LoggedInMember

On save it is stated that:

References are not supported for presentation conditions. Usage of reference Activity.Member is invalid here.
Activity.Member = LoggedInMember

How to accomplish that functionality?
Thanks a lot.
Elmar
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

Hi Elmar,

I'm a newbie myself & not far ahead of you on the learning curve with rules. Have you looked "under the hood" of the library sample application. I'm using that to learn about using rules.

Sorry I don't have an specific answer to your question.

Tom
Elmar
Posts: 62
Joined: Tue Mar 06, 2007 12:19 pm

Post by Elmar »

Hi Tom,

I´ve gone through some of the samples but of course some gems in there can only be found with some knowledge about the inner workings of AwareIM. It might be good idea to look at them again :D.

Thanks.
Elmar
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

I find my self continuously going back to both the manual & the library app & each time I another "layer" of understanding develops. I keep the library app in my current tree in the Configuration Tool so I can open it up without closing out the work I'm doing on my current project. When I'm all done, I then delete the library app from that tree.

Tom
Hubertus
Posts: 153
Joined: Sat Feb 11, 2006 2:11 pm
Location: Austria
Contact:

Post by Hubertus »

I wanted to implement a condition for an attribute where the current user can only edit self-created content.
I might be missing something but IMHO you only nedd to go to the "Access levels" branch in the Configuration Tool, select you BO and give the desired attribute "Creator: full access;others read" permission.

Hope it helps,
Hubertus
Elmar
Posts: 62
Joined: Tue Mar 06, 2007 12:19 pm

Post by Elmar »

Hi Hubertus.

You are absolutly right. From my explanaition that seemed to be the obvious way to go. What I meant though is that I have an attribute in an BO that´s a BO itself. With BO´s as another BO´s attribute I can define which operation options I want to show the user (edit, delete, view) seperatly.

My desired outcome would be to not even show the delete option to users that are not the owners of that content. I wasn´t sure if setting the access levels would also prevent the edit, delete options to show up in the presentation and just throw an error because of the access level definition.

In short: I wanted to avoid to even show these options in the presentation if the access levels are not sufficient.

Best regards,
Elmar
greg
Posts: 124
Joined: Sat Apr 23, 2005 12:46 am

Post by greg »

I found that it is often convenient to set up access rights dynamically. You need to add an attribute like BO.CreatorID and a rule

If BO IS NEW Then BO.CreatorID=LoggedInMember.ID

You can then add a protection rule

If LoggedInMember.ID<> BO.CreatorID
Then PROTECT BO FROM ALL EXCEPT Administrator AND System

Or you can only protect some attributes, even hide them by using READ PROTECT

This approach is similar to setting up Access level to creator only but it allows more flexibility. You may wish to have the BO or an attribute available to other users depending on other attributes. For example, you may only want to block access to records which were entered more than 2 days ago. If you write a record creation day in BO.CreatedOn and initialise it as CURRENT_DATE, then you can add a rule like this one

If LoggedInMember.ID<> BO.CreatorID AND
DAY_DIFFERENCE(BO.CreatedOn, CURRENT_DATE)>2
Then PROTECT BO FROM ALL EXCEPT Administrator AND System
Elmar
Posts: 62
Joined: Tue Mar 06, 2007 12:19 pm

Post by Elmar »

Hi greg.

Your answer is very appreciated and valuable. Thanks for making the effort to post this.

There are so many ways to accomplish things in AwareIM that I think it might be a good idea to open up a "Best practices"-Subforum where Users can post Tips on how to get things done easier/better whatever.

Regards,
Elmar
Post Reply