Forums / Setup & design / How to limit user access

How to limit user access

Author Message

Blake McDonald

Monday 29 November 2004 4:27:37 pm

How do I limit user access to be able to download different files?

I want to allow people logged on under one name to be able to download such and such PDF and others to download another. I wasn't able to figure out how to do this. I figured I could put them in different folders under media or something but I wasn't able to figure out how to limit users to access only some folders.

thanks

~Blake

Felix Laate

Tuesday 30 November 2004 6:06:16 am

Hi Blake!

Which version of ez Publish are you using?

felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

Blake McDonald

Tuesday 30 November 2004 10:31:44 am

it's ver 3.4.2

Felix Laate

Tuesday 30 November 2004 2:22:52 pm

Hi again!

Under roles, when you create a new rule (or edit an existing one), you can asign a node to a certain rule.

felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

Blake McDonald

Tuesday 30 November 2004 2:53:36 pm

Yeah I was able to do that and give access to like just the downloads or something once logged in... however I don't see how to only give someone access to only SOME of the downloads or only one of the folders under media etc.

Is there a way to do this?

Marko Žmak

Tuesday 30 November 2004 4:54:51 pm

Why don't you create two sections, then put one type of downloads into one section and the other type into the other section. Then create apropriate roles with this two sections in the role criterium, and assign the roles to apropriate user groups.

If you like this idea (and noone has a better one), I'll elaborate.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Tore Jørgensen

Tuesday 30 November 2004 11:01:12 pm

How about defining a role for each download folder (You can limit the role based on subtree). You can then add the role to individual users, or to groups. It is possible to assign a user to several groups by publishing him there.
http://www.ez.no/community/forum/developer/how_to_add_user_to_multiple_groups

Marko Žmak

Wednesday 01 December 2004 11:34:11 am

That could also work, but if you have a lot of download folders, that would be a lot of rules. And if you want 10 folders to have identical permissions, you would have to create 10 identical roles intead of just one.

Using Sections seems a better solution to me.

So Blake, does any of this help?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Blake McDonald

Wednesday 01 December 2004 12:40:50 pm

The section way may be better for what I want to do.

What I need to basicly do with this is allow different users access and to download such and such a file that coraspons with their login. I may also want to display other information unique to this person so I guess a section would do that? I would setup a different section per user or user group?

How exacly would I set up a section to do that? Would I be able to put basicly anything as well as files in this section that only the one user sees? I was getting a little confused trying to figure out how to give users permissions like that.
~Blake

Marko Žmak

Wednesday 01 December 2004 1:47:50 pm

Sections generally work like this:

You assign a secction to a node, and then that node, and all the nodes in it's subtree belong to this section.

For example lets say that you created a section called 'User Downloads', and assigned it to a folder 'Secret Downloads' in which are located the downloads which should be enabled only for logged users. Then in user roles you can define a role like this:

content read Section('User Downloads')

And then assign this role to a group users that you want to permit this downloads. And that's it.

I think that you can also put files from other folders (that are not in the subtree of 'Secret Downlads') into section 'User Downloads', by assinging them multiple locations, but I'm not 100% sure, you should verify this.

Hope this example helps, it's just an example to get what you realy need, you should do some additional stuff, but you'll figure it out. To figure out the rest read the eZ documentation about Sections, Users and Roles. After reading the docs, everything should be clear to you.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

John Smith

Friday 18 March 2005 8:15:31 am

What are roles and permission for downloading the pdf documents uploaded with articles.

cheers

Arran Price

Sunday 20 March 2005 2:36:44 pm

Just to offer another solution (which we have used).
You can make copies of the classes you want to restrict, such as the file class and then put different rules around the different classes.
The benefit of this is that you can retain the same layout for your site without having to split everything into different folders (subtrees/sections).

Alternatively, use different subtree/sections and then override a view to give you the view you require having done eg a fetch tree to get all the contents you want shown in one view.

Arran