A policy for a separate content object

Author Message

Marat M.

Monday 09 May 2005 10:38:21 am

As usual, first I will outline my situation and then will write my question.

For example, I create a folder in "Content structure" tab and call it - "Widgets". Then I open Setup -> Classes and create a content class naming it, say, "Widget". This class has the following attributes:

Att1: [TextLine] - Title
Att2: [Textfield] - TextBody

(actually I need much more fields but it doesn't matter right now)

Then I create a new section called "Widget section" and added a few objects (of "Widget" content class) in the folder "Widgets".

When I clear the caches and renew the site I see that there is a new section in the menu. That's nice. But I want some specific functionality for that section.

So this is my question: can I set user/role policies so that every guest user that logging into the site could only see those widgets that I assign to him/her?

For instance, I have two users registered with my site - George Bush and Vladimir Putin. :) Via the admin area I created three widgets in the folder "Widgets":

-widget1
-widget2
-widget3

And somehow I assigned the first two to George Bush and the last one - to V.Putin. So, when G.Bush logs in and click "Widgets" menu tab he sees only the first two widgets. The same is with V.Putin - he cannot see Bush's widgets, but only his own.

I tried to enter new attribute for the widget class - it is called "Object relation" and selected Guest users folder. But I don't know what to do further.

Thanks,
-Marat

kracker (the)

Tuesday 10 May 2005 2:44:35 am

Marat,

The short answer is: <i>Yes</i>!

The long answer is in part (I think) why no one else has replied to this thread is not an FAQ entry or quick solution.

Your going to want to do a lot of learning up on eZ publish to grok the basics of just how to implement this specific (detailed) functionality.

Try using the "Object Relation List" Attribute in you class. This attribute should allow you to specify a user account per object.

Then you might manipulate the display template for your custom class / object (we will call it personal-article) to only display the personal-article's which are associated with the currently logged in user, perhaps with a case to urge anonymous users to login to view their personal-articles .... *shrugs*

Although, in truth there may be several alternate implementations of your described functionality which may be more desirable ... not certain without digging deep.

I'll go to the mat for the community, I just can't do it all for ya. Someone else should really step in and make me look bad here by giving you more of an idea than my empty reply.

break a leg,
//kracker

Sole : If I had won ...
<i>would I even be here now? Or no one notices cause it doesn't really add up to represent enough to justify it yet.</i>

Sole : Da Baddest Poet ... <i>... Truth is, I only rap cause I ain't smart enough to write a</i> <b>book</b>

Member since: 2001.07.13 || http://ezpedia.se7enx.com/

Marat M.

Tuesday 10 May 2005 4:34:48 am

I think, logically all that should be implemented in this way:

1. I specify a user per each personal-article manually (actually I will do it exactly so).

2. In the template for displaying the "Widgets" folder I write a piece of code (perhaps 'if-then') that compares two variables - 'logged in user name' and 'the object relation list attribute' with one another. If they are the same - then the article is listed. If not - then false (not listed). I'll look up the documentation for eZ and learn if-then clause.

Maybe another implementation could be as follows:
to create a folder for each user and simply cut-paste the article into it. That would be much easier to implement as for the template code. However, it's a problem here on how to create a folder for each newly registered user :) It can be done manually but when there are hundreds of users it's a really frustrating work.
What do think? :)

Thanks,
Marat

kracker (the)

Tuesday 10 May 2005 4:53:32 am

Crushed for time so you'll have to play this out without me ...

I hear you 100% and your right but ...

That's even more complicated to setup, I would really suggest you look into acquiring an advanced eZ publish developer to either walk you through building the required kernel hack or extension in order to support this implementation or more realistically, be prepared to pay for at least some development from someone with direct experience with this.

Cause I have not seen a drop in solution in the community from which to source from ... although I do believe that VisionWT has contributed some interesting work in the eZ publish mailing list in a similar regard? Just about any of the eZ publish Solution Partners or eZ systems themselves should be able to help you out.

//kracker

Sage Francis : I Apologize (Ft Sole)

Member since: 2001.07.13 || http://ezpedia.se7enx.com/

Xavier Dutoit

Tuesday 10 May 2005 4:57:16 am

If you don't have too many groups (having different access rights):

Create several groups of users (say west and east),
Grant them different access rights:
East has a read access to section "east"
West has a read access to section "west"

Then assign the section to the widgets and it works.

X+

http://www.sydesy.com

Marat M.

Tuesday 10 May 2005 8:57:23 am

The question is that I need not an access of group of users to some content but of a separate user.
A separate user to separate objects (though within one folder).

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.