How to prevent unauthorized users from specific actions by assigning a role to them?

I am developing a web application by Yii php framework. In this application, I uses Right module for the role management of it. I define some roles and assign proper operation and tasks to them. I did it via the Right module UI and finally when each user fill the registration form a proper role assign to it, So for logged in users everything is ok. The problem is for Guest and unauthorized users. I set the default role in main.php configuration file only to 'Guest' and also set operations of 'Guest' role with Right module UI, but Guest users can do other not permitted actions! How can I do it for Guest users?

Thanks in Advance

Answers


I suggest you used your own UserIdentity class ...

it's so simple !


You Can Do like this

array('allow', 
            'actions'=>array('update'),
            'expression'=>Yii::app()->user->uType = 'mydefinedtype',
));

This can be set when the Login action done in useridentity.php

$this->setState('utype', $user->UTtype->typename);

Need Your Help

clj-ssh / JSch unable to load library 'c' on Windows

java ssh clojure jna jsch

I've added clj-ssh as a dependency to a Leiningen project, and I can (use 'clj-ssh.ssh) but calling (ssh-agent {}) gives the error

Importing Font to GUI

java swing user-interface fonts awt

I am trying to change the font for my GUI besides the basic 5 that swing seems to come with. How to import fonts and actually use them in my code?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.