Yii Framework Forum: How set Access Rules for static pages - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How set Access Rules for static pages Rate Topic: -----

#1 User is offline   fhelix72 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 53
  • Joined: 22-April 09
  • Location:Italy - Vicenza

Posted 17 February 2010 - 12:24 PM

Is there a way to set the accessRules for static pages (created with CViewAction), for instance if I want to allow access to my static pages only for authenticated users?
The normal accessRules let me to specify an action but not a view.
thanks
0

#2 User is offline   Onman 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 175
  • Joined: 26-December 09
  • Location:The Netherlands

Posted 17 February 2010 - 06:32 PM

static pages can only be accessed by calling a particular action, therefore your accessRules are sufficient for specifying access rights.
0

#3 User is offline   fhelix72 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 53
  • Joined: 22-April 09
  • Location:Italy - Vicenza

Posted 18 February 2010 - 03:17 AM

View PostOnman, on 17 February 2010 - 06:32 PM, said:

static pages can only be accessed by calling a particular action, therefore your accessRules are sufficient for specifying access rights.

I see that at the moment there is only one action "site/page" connected to the path "protected/views/site/pages") for all static pages, so if I put all my static pages in that folder I can't differentiate access rule.
So I immagine I should use different actions and different paths to differentiate static pages, I should specify in the function "actions" in siteController.php to use CViewAction for all actions but with different path (setting the basePath parameter) and then set properly accessRules in the controller.
Thats right?
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users