From 134e6e6092c73a4e09e710a5b717ff7b935ec3ee Mon Sep 17 00:00:00 2001 From: Romain Quetiez Date: Thu, 17 Sep 2009 13:38:25 +0000 Subject: [PATCH] Fixed regression on access control for the stimuli (also ipmlemented a workaround to a bug with the mantatory link attributes) SVN:trunk[177] --- addons/userrights/userrightsprofile.class.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/userrights/userrightsprofile.class.inc.php b/addons/userrights/userrightsprofile.class.inc.php index c12214066..aae8862c9 100644 --- a/addons/userrights/userrightsprofile.class.inc.php +++ b/addons/userrights/userrightsprofile.class.inc.php @@ -386,7 +386,7 @@ class URP_UserProfile extends UserRightsBaseClass "db_table" => "priv_urp_userprofile", "db_key_field" => "id", "db_finalclass_field" => "", - "display_template" => "../business/templates/default.html", + "display_template" => "", ); MetaModel::Init_Params($aParams); //MetaModel::Init_InheritAttributes(); @@ -396,7 +396,7 @@ class URP_UserProfile extends UserRightsBaseClass MetaModel::Init_AddAttribute(new AttributeExternalKey("profileid", array("targetclass"=>"URP_Profiles", "jointype"=> "", "label"=>"Profile", "description"=>"usage profile", "allowed_values"=>null, "sql"=>"profileid", "is_null_allowed"=>false, "depends_on"=>array()))); MetaModel::Init_AddAttribute(new AttributeExternalField("profile", array("label"=>"Profile", "description"=>"Profile name", "allowed_values"=>null, "extkey_attcode"=> 'profileid', "target_attcode"=>"name"))); - MetaModel::Init_AddAttribute(new AttributeString("reason", array("label"=>"Reason", "description"=>"explain why this person may have this role", "allowed_values"=>null, "sql"=>"description", "default_value"=>null, "is_null_allowed"=>false, "depends_on"=>array()))); + MetaModel::Init_AddAttribute(new AttributeString("reason", array("label"=>"Reason", "description"=>"explain why this person may have this role", "allowed_values"=>null, "sql"=>"description", "default_value"=>null, "is_null_allowed"=>true, "depends_on"=>array()))); //MetaModel::Init_InheritFilters(); MetaModel::Init_AddFilterFromAttribute("userid"); @@ -1162,7 +1162,7 @@ exit; foreach($this->GetMatchingProfiles($oUser, $sClass, $oObject) as $iProfile) { $oGrantRecord = $this->GetClassStimulusGrant($iProfile, $sClass, $sStimulusCode); - if (is_null($oGrantRecord)) + if (!is_null($oGrantRecord)) { // no need to fetch the record, we've requested the records having permission = 'yes' $iInstancePermission = UR_ALLOWED_YES;