farBarnacle has a function "updateRight" that you would use to grant a permission to a role for an object. It accepts role, permission, object (as UUIDs), and right arguments. farRole and farPermission have getID functions for retrieving the objectid for a named role / permission. The right argument should be -1 for deny or 1 for grant (0 is inherit - only useful for heirarchical data like the navigation).
The best example of this is the adminPermissions webskin in core on types. This is the UI for changing object permissions. On Fri, Jan 9, 2009 at 6:41 AM, Tomek Kott <[email protected]> wrote: > I see, an easier way then I think would be just to do extend dmFile into > dmSecureFile or something similar and do it that way. > > Is there an example I can look at for setting the permissions correctly by > default? > > Thanks > > Tomek > > > On Wed, Jan 7, 2009 at 9:06 PM, Blair McKenzie <[email protected]> wrote: > >> If you want file to be default allow, you will have to add the permission >> to the object as part of creating it. >> >> >> On Thu, Jan 8, 2009 at 12:27 PM, Tomek Kott <[email protected]> wrote: >> >>> I was trying to set up a secure file download section, and followed the >>> instructions listed here: >>> http://docs.farcrycms.org/display/FCDEV50/Object+specific+permissions >>> However, I was wondering if there was a way to have default-allow for the >>> security settings --- I already have a lot of files uploaded, so changing >>> them all would be a pain. I figured that the easiest way would be to create >>> my own permission ("viewFile"), link it to dmFile (since it is added to >>> farBarnacle), and edit the Anonymous role to have that permission. However, >>> when I go and check the "manage permissions" under any file, it lists >>> anonymous -> Deny. So apparently I'm doing something wrong. >>> >>> Any ideas? >>> >>> Thanks, >>> >>> Tomek >>> >>> >>> >> >> >> > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "farcry-dev" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/farcry-dev?hl=en -~----------~----~----~----~------~----~------~--~---
