In 4.11 I had a file type (extended dmFile) that I was protecting
using categories (form tool list to policygroups in object admin) then
checking for lpolicygroupids in download.cfm (using a modified version
of David Whiterod's securefiles plugin
http://groups.google.com/group/farcry-dev/browse_thread/thread/99f01a14bd276811/9e498ea204633ed6?lnk=gst&q=securefiles#9e498ea204633ed6).

This made it really easy for a publisher to add a new "file" in my
case "servicerepfile" and "check off" the groups that could download
it.

After migrating the 5.1, lpolicygroupids no longer contains the right
values so I struggled with how I was going to reapply security to
these objects. I looked over the "adding permissions to types" in the
docs (http://docs.farcrycms.org/display/FCDEV50/Object+specific
+permissions)
but the idea of having to go in and add view permissions to 800
objects was unappealing, AND the process of managing the permisions
seemed cumbersome for my average publisher.

Ultimately I settled on creating a new permission Service Rep File
View (shortcut: "SRFILEVIEW"), and assigned the 3 or 4 roles to it
that need access.

In download.cfm, I saw a todo: to check for standard view permissions,
so I dropped my code right there, it looks like the below and seems to
work. If this is not the way to achieve this result please explain.

<!--- croth: Check for various "type" permissions AND standard view ---
>
<cfswitch expression="#attributes.typename#">

<cfcase value="cmiservicerepfile">

   <cfif application.security.checkPermission(permission="SRFILEVIEW")
NEQ 1>
      <cfthrow type="core.tags.farcry.download" message="File not
available." detail="You must be a service rep to view this file." />
   </cfif>

</cfcase>

<cfdefaultcase>

        <cfif application.security.checkPermission
(permission="View",object=attributes.objectid) NEQ 1>
        <cfthrow type="core.tags.farcry.download" message="File not
available." detail="You do not have permission to view this file." />
    </cfif>

</cfdefaultcase>

</cfswitch>

I put the standard view check in there in the event that I add object
specific permissions to the core dmfile type.

So this is all fine an good, but I'd like to find out how people are
making pretty messaging to the user when you encounter the error
(cfthrow).

In FC4, if a file was in draft for example, it would output a message
to that effect and provide the login box.

I seen in FC5, you can message the user in some sort of bubble thing
(like when you enter invalid login info).

How can I, instead of throwing a message, redirect a user to the login
page, and pass the messaging I want, AND how do I extend the amount of
time the bubble appears (I have noticed some users do not see it) OR,
display the message in a way OTHER than the nifty bubble?

Thanks!

Chris
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to