Permalink
Browse files

changing from checkAccess to isAssigned when seeing whether or not a …

…user is already assigned to a role in the assign method
  • Loading branch information...
1 parent 49809df commit 48459744b57f6fa623f4505378284537386b2ecd Jeff Winesett committed Dec 18, 2012
@@ -70,7 +70,7 @@ public function assign()
$this->project->assignUser($this->_user->id, $this->role);
//add the association, along with the RBAC biz rule, to our RBAC hierarchy
$auth = Yii::app()->authManager;
- if(!$auth->checkAccess($this->role, $this->_user->id))
+ if(!$auth->isAssigned($this->role, $this->_user->id))
{
$bizRule='return isset($params["project"]) && $params["project"]->allowCurrentUser("'.$this->role.'");';
$auth->assign($this->role,$this->_user->id, $bizRule);
@@ -70,7 +70,7 @@ public function assign()
$this->project->assignUser($this->_user->id, $this->role);
//add the association, along with the RBAC biz rule, to our RBAC hierarchy
$auth = Yii::app()->authManager;
- if(!$auth->checkAccess($this->role, $this->_user->id))
+ if(!$auth->isAssigned($this->role, $this->_user->id))
{
$bizRule='return isset($params["project"]) && $params["project"]->allowCurrentUser("'.$this->role.'");';
$auth->assign($this->role,$this->_user->id, $bizRule);
@@ -70,7 +70,7 @@ public function assign()
$this->project->assignUser($this->_user->id, $this->role);
//add the association, along with the RBAC biz rule, to our RBAC hierarchy
$auth = Yii::app()->authManager;
- if(!$auth->checkAccess($this->role, $this->_user->id))
+ if(!$auth->isAssigned($this->role, $this->_user->id))
{
$bizRule='return isset($params["project"]) && $params["project"]->allowCurrentUser("'.$this->role.'");';
$auth->assign($this->role,$this->_user->id, $bizRule);
@@ -70,7 +70,7 @@ public function assign()
$this->project->assignUser($this->_user->id, $this->role);
//add the association, along with the RBAC biz rule, to our RBAC hierarchy
$auth = Yii::app()->authManager;
- if(!$auth->checkAccess($this->role, $this->_user->id))
+ if(!$auth->isAssigned($this->role, $this->_user->id))
{
$bizRule='return isset($params["project"]) && $params["project"]->allowCurrentUser("'.$this->role.'");';
$auth->assign($this->role,$this->_user->id, $bizRule);
@@ -70,7 +70,7 @@ public function assign()
$this->project->assignUser($this->_user->id, $this->role);
//add the association, along with the RBAC biz rule, to our RBAC hierarchy
$auth = Yii::app()->authManager;
- if(!$auth->checkAccess($this->role, $this->_user->id))
+ if(!$auth->isAssigned($this->role, $this->_user->id))
{
$bizRule='return isset($params["project"]) && $params["project"]->allowCurrentUser("'.$this->role.'");';
$auth->assign($this->role,$this->_user->id, $bizRule);
@@ -70,7 +70,7 @@ public function assign()
$this->project->assignUser($this->_user->id, $this->role);
//add the association, along with the RBAC biz rule, to our RBAC hierarchy
$auth = Yii::app()->authManager;
- if(!$auth->checkAccess($this->role, $this->_user->id))
+ if(!$auth->isAssigned($this->role, $this->_user->id))
{
$bizRule='return isset($params["project"]) && $params["project"]->allowCurrentUser("'.$this->role.'");';
$auth->assign($this->role,$this->_user->id, $bizRule);
@@ -69,7 +69,7 @@ public function assign()
$this->project->assignUser($this->_user->id, $this->role);
//add the association, along with the RBAC biz rule, to our RBAC hierarchy
$auth = Yii::app()->authManager;
- if(!$auth->checkAccess($this->role, $this->_user->id))
+ if(!$auth->isAssigned($this->role, $this->_user->id))
{
$bizRule='return isset($params["project"]) && $params["project"]->allowCurrentUser("'.$this->role.'");';
$auth->assign($this->role,$this->_user->id, $bizRule);

0 comments on commit 4845974

Please sign in to comment.