Re: Question about use ACL with paginate

2010-02-11 Thread anl hp
Something I don't see clear from this approach is, how can I have permissions on 'create' for a document that's not been yet created?, When I see this method I can only see 'documents' as a 'resource' an 'interface' or in the current context, as a 'controller', setting permits on documents treated

Re: Question about use ACL with paginate

2010-02-11 Thread Guillermo Mansilla
Yes, you are right, forget the create field. My mistake. You should have only 3 fields regarding to permissions: Read, Update, Delete, so you can still implement my idea On 11 February 2010 06:00, anl hp anle...@gmail.com wrote: Something I don't see clear from this approach is, how can I have

Question about use ACL with paginate

2010-02-10 Thread marco.rizze...@gmail.com
Hi I have this question: I use ACL for manage the access to documents by users. Now I must display a list of all documents that are accessible by the logged user. This list must be paginated. I have no idea about how to do this and I think to abandon the ACL and manage the permits with a big table

Re: Question about use ACL with paginate

2010-02-10 Thread anler
Are you aking how find the allowed docs or how to paginate this result (or both)? I did something similar once but with a different approach, since I was working with 'resources' instead of documents, I listed the resources and the option 'access info' to show the permits for that resource (this

Re: Question about use ACL with paginate

2010-02-10 Thread marco.rizze...@gmail.com
Can you explain better what is your solution. I explain better my situation: Model : Group: (HABTM User) User:(HABTM:Group) Document I have to manage permissions to access to documents. Some users can modify some documents , some users can only read some documents(I must also register when a

Re: Question about use ACL with paginate

2010-02-10 Thread anler
I think the BEST way is using ACL, and yes, it's complex, but give you reliability for free, even more if you are mixin groups in the coctel (group permits are inherited by users of that group, and things like that), with ACL you could handle better reading and writing documents through

Re: Question about use ACL with paginate

2010-02-10 Thread marco.rizze...@gmail.com
Ok many thanks. Using the solution that you have suggested I don't need to use ACL. In this case for manage permissions expressed by group on a document (like Group A can read Document 1) I must find all users that belong to the group and insert a record in all two tables(LineDoc and DocPermit)

Re: Question about use ACL with paginate

2010-02-10 Thread anl hp
Forgive me, but I'm making a mess, now you're saying: I must find all users that belong to the group and insert a record in all two tables(LineDoc and DocPermit) for every user. I believe I don't understand you quite well at first time, but anyway, If you going to do that, may be is better for you

Re: Question about use ACL with paginate

2010-02-10 Thread marco.rizze...@gmail.com
I try to explain better. I have users that belongs to groups (a user can belong to many group and a group can have many users) Then I have documents. I must manage permissions on documents. Permissions are : read a document, edit a document etc... Permission can be defined in raltion to groups or

Re: Question about use ACL with paginate

2010-02-10 Thread Guillermo Mansilla
I think about this: Have a table (with its model) named documents_permissions with the following fields id, document_id, user_id, group_id, read, create, update, delete this model belongs To: User, Group, Document Since a user may be part of many groups and some times you may have cases like this:

Re: Question about use ACL with paginate

2010-02-10 Thread guille1983
Oh... I see the data got lost The tables look like this: id: 1 document_id: 9 user_id: null group_id: 1 create: 0 read: 1 update: 0 delele: 0 On 10 feb, 21:04, Guillermo Mansilla mansil...@gmail.com wrote: I think about this: Have a table (with its model) named documents_permissions with the