berichten: beheerder ook herkennen buiten organisatie 'system'
checkadmin() zocht het niveau op bij de gekozen organisatie (globorgid), waardoor een systeembeheerder in een andere organisatie geen berichten meer kon maken. Nu eerst $this->super (systeembeheerder/helpdesk); checkrechten() gebruikt dezelfde regel. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -27,23 +27,15 @@ class Berichten extends MY_Controller {
|
|||||||
function checkrechten()
|
function checkrechten()
|
||||||
{
|
{
|
||||||
if ( ! $this->userid ) die;
|
if ( ! $this->userid ) die;
|
||||||
$orguserid = $this->Orgusers_model->get_fieldvalue( array("user_id" => $this->userid, "organisatie_id" => $this->globorgid), "id" );
|
echo json_encode( $this->checkadmin() );
|
||||||
$niveau = $this->Autorisaties_model->get_fieldvalue( array("orguser_id" => $orguserid), "nivo_id" );
|
|
||||||
|
|
||||||
if ( $niveau == 1 || $niveau == 2 )
|
|
||||||
{
|
|
||||||
echo json_encode( TRUE );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
echo json_encode( FALSE );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// beheerder = ingelogd met autorisatieniveau 1 of 2 (zelfde regel als checkrechten)
|
// beheerder = systeembeheerder/helpdesk (super, ongeacht gekozen organisatie)
|
||||||
|
// of niveau 1/2 bij de gekozen organisatie
|
||||||
private function checkadmin(){
|
private function checkadmin(){
|
||||||
if ( ! $this->userid ) return FALSE;
|
if ( ! $this->userid ) return FALSE;
|
||||||
|
if ( $this->super ) return TRUE;
|
||||||
$orguserid = $this->Orgusers_model->get_fieldvalue( array("user_id" => $this->userid, "organisatie_id" => $this->globorgid), "id" );
|
$orguserid = $this->Orgusers_model->get_fieldvalue( array("user_id" => $this->userid, "organisatie_id" => $this->globorgid), "id" );
|
||||||
$niveau = $this->Autorisaties_model->get_fieldvalue( array("orguser_id" => $orguserid), "nivo_id" );
|
$niveau = $this->Autorisaties_model->get_fieldvalue( array("orguser_id" => $orguserid), "nivo_id" );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user