Merge pull request #1540 from ralpheav/master
Adding permission Name field
This commit is contained in:
@@ -41,8 +41,13 @@ if ($TYPE_DATA == 'show')
|
||||
$oDataset = $RBAC->getAllPermissions( $ROL_UID, $RBAC->sSystem, $filter, 1 );
|
||||
|
||||
$rows = Array ();
|
||||
$per = new RolesPermissions();
|
||||
while ($oDataset->next()) {
|
||||
$rows[] = $oDataset->getRow();
|
||||
$row = $oDataset->getRow();
|
||||
$per->setPerUid($row['PER_UID']);
|
||||
$row['PER_NAME'] = $per->getPermissionName();
|
||||
$rows[] = $row;
|
||||
}
|
||||
|
||||
echo '{permissions: ' . G::json_encode( $rows ) . '}';
|
||||
|
||||
|
||||
@@ -251,13 +251,20 @@ switch ($REQUEST) {
|
||||
$content = new Content();
|
||||
$rNames = $content->getAllContentsByRole();
|
||||
$aUsers = $RBAC->getAllUsersByRole();
|
||||
|
||||
$aRows = Array ();
|
||||
while ($rs->next()) {
|
||||
$aRows[] = $rs->getRow();
|
||||
$index = sizeof( $aRows ) - 1;
|
||||
$aRows[$index]['ROL_NAME'] = isset( $rNames[$aRows[$index]['ROL_UID']] ) ? $rNames[$aRows[$index]['ROL_UID']] : '';
|
||||
$aRows[$index]['TOTAL_USERS'] = isset( $aUsers[$aRows[$index]['ROL_UID']] ) ? $aUsers[$aRows[$index]['ROL_UID']] : 0;
|
||||
$roleUid = $aRows[$index]['ROL_UID'];
|
||||
if (!isset($rNames[$roleUid])) {
|
||||
$rol = new Roles();
|
||||
$row = $rol->load($roleUid);
|
||||
$rolname = $row['ROL_NAME'];
|
||||
} else {
|
||||
$rolname = $rNames[$roleUid];
|
||||
}
|
||||
$aRows[$index]['ROL_NAME'] = $rolname;
|
||||
$aRows[$index]['TOTAL_USERS'] = isset( $aUsers[$roleUid] ) ? $aUsers[$roleUid] : 0;
|
||||
}
|
||||
|
||||
$oData = RolesPeer::doSelectRS( $Criterias['COUNTER'] );
|
||||
@@ -297,6 +304,18 @@ switch ($REQUEST) {
|
||||
}
|
||||
echo '{success:' . $response . '}';
|
||||
break;
|
||||
case 'updatePermissionContent':
|
||||
/*
|
||||
$per_code = $_POST['PER_NAME'];
|
||||
$per_uid = isset( $_POST['PER_UID'] ) ? $_POST['PER_UID'] : '';
|
||||
require_once 'classes/model/Content.php';
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->add( ContentPeer::CON_CATEGORY, 'PER_NAME' );
|
||||
$oCriteria->add( ContentPeer::CON_ID, $per_uid );
|
||||
$oCriteria->add( ContentPeer::CON_VALUE, $per_code );
|
||||
$oDataset = ContentPeer::doSelectRS( $oCriteria );
|
||||
*/
|
||||
break;
|
||||
default:
|
||||
echo 'default';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user