本文整理汇总了PHP中SecurityGroup::groupHasAccess方法的典型用法代码示例。如果您正苦于以下问题:PHP SecurityGroup::groupHasAccess方法的具体用法?PHP SecurityGroup::groupHasAccess怎么用?PHP SecurityGroup::groupHasAccess使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SecurityGroup
的用法示例。
在下文中一共展示了SecurityGroup::groupHasAccess方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testgroupHasAccess
public function testgroupHasAccess()
{
//test for listview
$result = SecurityGroup::groupHasAccess('', '[SELECT_ID_LIST]');
$this->assertEquals(true, $result);
//test with invalid values
$result = SecurityGroup::groupHasAccess('', '');
$this->assertEquals(false, $result);
//test with valid values
$result = SecurityGroup::groupHasAccess('Users', '1');
$this->assertEquals(false, $result);
}
示例2: listviewACLHelper
function listviewACLHelper()
{
$array_assign = parent::listviewACLHelper();
$is_owner = false;
$in_group = false;
//SECURITY GROUPS
if (!empty($this->parent_name)) {
if (!empty($this->parent_name_owner)) {
global $current_user;
$is_owner = $current_user->id == $this->parent_name_owner;
} else {
if (!empty($this->parent_type) && !empty($this->parent_id)) {
global $current_user;
$parent_bean = BeanFactory::getBean($this->parent_type, $this->parent_id);
if ($parent_bean !== false) {
$is_owner = $current_user->id == $parent_bean->assigned_user_id;
}
}
}
require_once "modules/SecurityGroups/SecurityGroup.php";
$in_group = SecurityGroup::groupHasAccess($this->parent_type, $this->parent_id, 'view');
/* END - SECURITY GROUPS */
}
/* BEGIN - SECURITY GROUPS */
/**
if(!ACLController::moduleSupportsACL($this->parent_type) || ACLController::checkAccess($this->parent_type, 'view', $is_owner)){
*/
if (!ACLController::moduleSupportsACL($this->parent_type) || ACLController::checkAccess($this->parent_type, 'view', $is_owner, 'module', $in_group)) {
/* END - SECURITY GROUPS */
$array_assign['PARENT'] = 'a';
} else {
$array_assign['PARENT'] = 'span';
}
$is_owner = false;
$in_group = false;
//SECURITY GROUPS
if (!empty($this->contact_name)) {
if (!empty($this->contact_name_owner)) {
global $current_user;
$is_owner = $current_user->id == $this->contact_name_owner;
} else {
global $current_user;
$parent_bean = BeanFactory::getBean('Contacts', $this->contact_id);
if ($parent_bean !== false) {
$is_owner = $current_user->id == $parent_bean->assigned_user_id;
}
}
require_once "modules/SecurityGroups/SecurityGroup.php";
$in_group = SecurityGroup::groupHasAccess('Contacts', $this->contact_id, 'view');
/* END - SECURITY GROUPS */
}
/* BEGIN - SECURITY GROUPS */
/**
if( ACLController::checkAccess('Contacts', 'view', $is_owner)){
*/
if (ACLController::checkAccess('Contacts', 'view', $is_owner, 'module', $in_group)) {
/* END - SECURITY GROUPS */
$array_assign['CONTACT'] = 'a';
} else {
$array_assign['CONTACT'] = 'span';
}
return $array_assign;
}
示例3: process_dynamic_listview_rows
//.........这里部分代码省略.........
}
$oddRow = !$oddRow;
$button_contents = array();
$this->xTemplate->assign("ROW_COLOR", $ROW_COLOR);
$this->xTemplate->assign("BG_COLOR", $BG_COLOR);
$layout_manager = $this->getLayoutManager();
$layout_manager->setAttribute('context', 'List');
$layout_manager->setAttribute('image_path', $this->local_image_path);
$layout_manager->setAttribute('module_name', $subpanel_def->_instance_properties['module']);
if (!empty($this->child_focus)) {
$layout_manager->setAttribute('related_module_name', $this->child_focus->module_dir);
}
//AG$subpanel_data = $this->list_field_defs;
//$bla = array_pop($subpanel_data);
//select which sub-panel to display here, the decision will be made based on the type of
//the sub-panel and panel in the bean being processed.
if ($subpanel_def->isCollection()) {
$thepanel = $subpanel_def->sub_subpanels[$aItem->panel_name];
} else {
$thepanel = $subpanel_def;
}
/* BEGIN - SECURITY GROUPS */
//This check is costly doing it field by field in the below foreach
//instead pull up here and do once per record....
$aclaccess_is_owner = false;
$aclaccess_in_group = false;
global $current_user;
if (is_admin($current_user)) {
$aclaccess_is_owner = true;
} else {
$aclaccess_is_owner = $aItem->isOwner($current_user->id);
}
require_once "modules/SecurityGroups/SecurityGroup.php";
$aclaccess_in_group = SecurityGroup::groupHasAccess($aItem->module_dir, $aItem->id);
/* END - SECURITY GROUPS */
//get data source name
$linked_field = $thepanel->get_data_source_name();
$linked_field_set = $thepanel->get_data_source_name(true);
static $count;
if (!isset($count)) {
$count = 0;
}
/* BEGIN - SECURITY GROUPS */
/**
$field_acl['DetailView'] = $aItem->ACLAccess('DetailView');
$field_acl['ListView'] = $aItem->ACLAccess('ListView');
$field_acl['EditView'] = $aItem->ACLAccess('EditView');
$field_acl['Delete'] = $aItem->ACLAccess('Delete');
*/
//pass is_owner, in_group...vars defined above
$field_acl['DetailView'] = $aItem->ACLAccess('DetailView', $aclaccess_is_owner, $aclaccess_in_group);
$field_acl['ListView'] = $aItem->ACLAccess('ListView', $aclaccess_is_owner, $aclaccess_in_group);
$field_acl['EditView'] = $aItem->ACLAccess('EditView', $aclaccess_is_owner, $aclaccess_in_group);
$field_acl['Delete'] = $aItem->ACLAccess('Delete', $aclaccess_is_owner, $aclaccess_in_group);
/* END - SECURITY GROUPS */
foreach ($thepanel->get_list_fields() as $field_name => $list_field) {
//add linked field attribute to the array.
$list_field['linked_field'] = $linked_field;
$list_field['linked_field_set'] = $linked_field_set;
$usage = empty($list_field['usage']) ? '' : $list_field['usage'];
if ($usage == 'query_only' && !empty($list_field['force_query_only_display'])) {
//if you are here you have column that is query only but needs to be displayed as blank. This is helpful
//for collections such as Activities where you have a field in only one object and wish to show it in the subpanel list
$count++;
$widget_contents = ' ';
$this->xTemplate->assign('CLASS', "");
示例4: doSearch
function doSearch($index, $queryString, $start = 0, $amount = 20)
{
global $current_user;
$cachePath = 'cache/modules/AOD_Index/QueryCache/' . md5($queryString);
if (is_file($cachePath)) {
$mTime = getCorrectMTime($cachePath);
if ($mTime > time() - 5 * 60) {
$hits = unserialize(sugar_file_get_contents($cachePath));
}
}
if (!isset($hits)) {
$tmphits = $index->find($queryString);
$hits = array();
foreach ($tmphits as $hit) {
$bean = BeanFactory::getBean($hit->record_module, $hit->record_id);
if (empty($bean)) {
continue;
}
if ($bean->bean_implements('ACL') && !is_admin($current_user)) {
//Annoyingly can't use the following as it always passes true for is_owner checks on list
//$bean->ACLAccess('list');
$in_group = SecurityGroup::groupHasAccess($bean->module_dir, $bean->id, 'list');
$is_owner = $bean->isOwner($current_user->id);
$access = ACLController::checkAccess($bean->module_dir, 'list', $is_owner, 'module', $in_group);
if (!$access) {
continue;
}
}
$newHit = new stdClass();
$newHit->record_module = $hit->record_module;
$newHit->record_id = $hit->record_id;
$newHit->score = $hit->score;
$newHit->label = getModuleLabel($bean->module_name);
$newHit->name = $bean->get_summary_text();
$newHit->summary = getRecordSummary($bean);
$newHit->date_entered = $bean->date_entered;
$newHit->date_modified = $bean->date_modified;
$hits[] = $newHit;
}
//Cache results so pagination is nice and snappy.
cacheQuery($queryString, $hits);
}
$total = count($hits);
$hits = array_slice($hits, $start, $amount);
$res = array('total' => $total, 'hits' => $hits);
return $res;
}
示例5: get_activities
/**
* Get array of activities
* @param array $activities
* @param string $user_id
* @param boolean $show_tasks
* @param SugarDateTime $view_start_time start date
* @param SugarDateTime $view_end_time end date
* @param string $view view; not used for now, left for compatibility
* @param boolean $show_calls
* @param boolean $show_completed use to allow filtering completed events
* @return array
*/
function get_activities($activities, $user_id, $show_tasks, $view_start_time, $view_end_time, $view, $show_calls = true, $show_completed = true)
{
global $current_user;
global $beanList;
$act_list = array();
$seen_ids = array();
$completedCalls = '';
$completedMeetings = '';
$completedTasks = '';
if (!$show_completed) {
$completedCalls = " AND calls.status = 'Planned' ";
$completedMeetings = " AND meetings.status = 'Planned' ";
$completedTasks = " AND tasks.status != 'Completed' ";
}
foreach ($activities as $key => $activity) {
if (ACLController::checkAccess($key, 'list', true)) {
/* END - SECURITY GROUPS */
$class = $beanList[$key];
$bean = new $class();
if ($current_user->id == $user_id) {
$bean->disable_row_level_security = true;
}
$where = self::get_occurs_until_where_clause($bean->table_name, $bean->rel_users_table, $view_start_time, $view_end_time, $activity['start'], $activity['end'], $view);
if ($key == "Meeting") {
$where .= $completedMeetings;
} elseif ($key == "Calls") {
$where .= $completedCalls;
if (!$show_calls) {
continue;
}
} elseif ($key == "Tasks") {
$where .= $completedTasks;
if (!$show_tasks) {
continue;
}
}
$focus_list = build_related_list_by_user_id($bean, $user_id, $where);
foreach ($focus_list as $focusBean) {
if (isset($seen_ids[$focusBean->id])) {
continue;
}
/* BEGIN - SECURITY GROUPS */
//Show as busy if current user is not in a group associated to the record
require_once "modules/SecurityGroups/SecurityGroup.php";
$in_group = SecurityGroup::groupHasAccess($key, $focusBean->id, 'list');
$show_as_busy = !ACLController::checkAccess($key, 'list', $current_user->id == $user_id, 'module', $in_group);
$focusBean->show_as_busy = $show_as_busy;
/* END - SECURITY GROUPS */
$seen_ids[$focusBean->id] = 1;
$act = new CalendarActivity($focusBean);
if (!empty($act)) {
$act_list[] = $act;
}
}
}
}
return $act_list;
}
示例6: ACLAccess
/**
function ACLAccess($view,$is_owner='not_set')
*/
function ACLAccess($view, $is_owner = 'not_set', $in_group = 'not_set')
{
global $current_user;
if ($current_user->isAdmin()) {
return true;
}
$not_set = false;
/**
if($is_owner == 'not_set')
*/
if ($is_owner === 'not_set') {
$not_set = true;
$is_owner = $this->isOwner($current_user->id);
}
// DJM - OBS Customizations - May 2009
// Moved this code to convert to lowercase from below.
// Added new action variable.
$view = strtolower($view);
$action = '';
// DJM - OBS Customizations - END CHANGE
if ($in_group === 'not_set') {
require_once "modules/SecurityGroups/SecurityGroup.php";
// DJM - OBS Customizations - May 2009
// Added the following switch statement to convert the view
// into an action value. As per the switch below.
// Added the action parameter to the groupHasAccess call.
switch ($view) {
case 'list':
case 'index':
case 'listview':
$action = "list";
break;
case 'edit':
case 'save':
case 'popupeditview':
case 'editview':
$action = "edit";
break;
case 'view':
case 'detail':
case 'detailview':
$action = "view";
break;
case 'delete':
$action = "delete";
break;
case 'export':
$action = "export";
break;
case 'import':
$action = "import";
break;
default:
$action = "";
break;
}
$in_group = SecurityGroup::groupHasAccess($this->module_dir, $this->id, $action);
// DJM - OBS Customizations - END CHANGE
}
//if we don't implent acls return true
if (!$this->bean_implements('ACL')) {
return true;
}
$view = strtolower($view);
switch ($view) {
case 'list':
case 'index':
case 'listview':
/**
return ACLController::checkAccess($this->module_dir,'list', true);
*/
return ACLController::checkAccess($this->module_dir, 'list', true, $this->acltype, $in_group);
case 'edit':
case 'save':
if (!$is_owner && $not_set && !empty($this->id)) {
$class = get_class($this);
$temp = new $class();
if (!empty($this->fetched_row) && !empty($this->fetched_row['id']) && !empty($this->fetched_row['assigned_user_id']) && !empty($this->fetched_row['created_by'])) {
$temp->populateFromRow($this->fetched_row);
} else {
$temp->retrieve($this->id);
}
$is_owner = $temp->isOwner($current_user->id);
}
case 'popupeditview':
case 'editview':
/**
return ACLController::checkAccess($this->module_dir,'edit', $is_owner, $this->acltype);
*/
return ACLController::checkAccess($this->module_dir, 'edit', $is_owner, $this->acltype, $in_group);
case 'view':
case 'detail':
case 'detailview':
/**
return ACLController::checkAccess($this->module_dir,'view', $is_owner, $this->acltype);
*/
return ACLController::checkAccess($this->module_dir, 'view', $is_owner, $this->acltype, $in_group);
//.........这里部分代码省略.........
示例7: get_list_view_data
function get_list_view_data()
{
$data = parent::get_list_view_data();
$delete = '';
/* BEGIN - SECURITY GROUPS */
/**
if (ACLController::moduleSupportsACL($data['RELATED_MODULE']) && !ACLController::checkAccess($data['RELATED_MODULE'], 'view', $data['CREATED_BY'] == $GLOBALS['current_user']->id) && !ACLController::checkAccess($data['RELATED_MODULE'], 'list', $data['CREATED_BY'] == $GLOBALS['current_user']->id)){
*/
if (ACLController::moduleSupportsACL($data['RELATED_MODULE'])) {
$in_group = 'not_set';
require_once "modules/SecurityGroups/SecurityGroup.php";
$in_group = SecurityGroup::groupHasAccess($data['RELATED_MODULE'], $data['RELATED_ID'], 'list');
if (!ACLController::checkAccess($data['RELATED_MODULE'], 'view', $data['CREATED_BY'] == $GLOBALS['current_user']->id, 'module', $in_group) && !ACLController::checkAccess($data['RELATED_MODULE'], 'list', $data['CREATED_BY'] == $GLOBALS['current_user']->id, 'module', $in_group)) {
$data['NAME'] = '';
return $data;
}
}
if (is_admin($GLOBALS['current_user']) || isset($data['CREATED_BY']) && $data['CREATED_BY'] == $GLOBALS['current_user']->id) {
$delete = ' - <a id="sugarFeedDeleteLink' . $data['ID'] . '" href="#" onclick=\'SugarFeed.deleteFeed("' . $data['ID'] . '", "{this.id}"); return false;\'>' . $GLOBALS['app_strings']['LBL_DELETE_BUTTON_LABEL'] . '</a>';
}
/* END - SECURITY GROUPS */
$data['NAME'] .= $data['DESCRIPTION'];
$data['NAME'] = '<div style="padding:3px">' . html_entity_decode($data['NAME']);
if (!empty($data['LINK_URL'])) {
$linkClass = SugarFeed::getLinkClass($data['LINK_TYPE']);
if ($linkClass !== FALSE) {
$data['NAME'] .= $linkClass->getDisplay($data);
}
}
$data['NAME'] .= '<div class="byLineBox"><span class="byLineLeft">';
$data['NAME'] .= $this->getTimeLapse($data['DATE_ENTERED']) . ' </span><div class="byLineRight"><a id="sugarFeedReplyLink' . $data['ID'] . '" href="#" onclick=\'SugarFeed.buildReplyForm("' . $data['ID'] . '", "{this.id}", this); return false;\'>' . $GLOBALS['app_strings']['LBL_EMAIL_REPLY'] . '</a>' . $delete . '</div></div>';
$data['NAME'] .= $this->fetchReplies($data);
return $data;
}
示例8: get_activities
function get_activities($user_id, $show_tasks, $view_start_time, $view_end_time, $view)
{
global $current_user;
$act_list = array();
$seen_ids = array();
// get all upcoming meetings, tasks due, and calls for a user
/* BEGIN - SECURITY GROUPS */
/**
if(ACLController::checkAccess('Meetings', 'list', $current_user->id == $user_id)) {
*/
if (ACLController::checkAccess('Meetings', 'list', true)) {
//$current_user->id == $user_id)) {
/* END - SECURITY GROUPS */
$meeting = new Meeting();
if ($current_user->id == $user_id) {
$meeting->disable_row_level_security = true;
}
$where = CalendarActivity::get_occurs_within_where_clause($meeting->table_name, $meeting->rel_users_table, $view_start_time, $view_end_time, 'date_start', $view);
$focus_meetings_list = build_related_list_by_user_id($meeting, $user_id, $where);
foreach ($focus_meetings_list as $meeting) {
if (isset($seen_ids[$meeting->id])) {
continue;
}
/* BEGIN - SECURITY GROUPS */
require_once "modules/SecurityGroups/SecurityGroup.php";
$in_group = SecurityGroup::groupHasAccess('Meetings', $meeting->id, 'list');
$show_as_busy = !ACLController::checkAccess('Meetings', 'list', $current_user->id == $user_id, 'module', $in_group);
$meeting->show_as_busy = $show_as_busy;
/* END - SECURITY GROUPS */
$seen_ids[$meeting->id] = 1;
$act = new CalendarActivity($meeting);
if (!empty($act)) {
$act_list[] = $act;
}
}
}
/* BEGIN - SECURITY GROUPS */
// get all upcoming meetings, tasks due, and calls for a user
/**
if(ACLController::checkAccess('Calls', 'list',$current_user->id == $user_id)) {
*/
if (ACLController::checkAccess('Calls', 'list', true)) {
//$current_user->id == $user_id)) {
$show_as_busy = !ACLController::checkAccess('Calls', 'list', $current_user->id == $user_id);
/* END - SECURITY GROUPS */
$call = new Call();
if ($current_user->id == $user_id) {
$call->disable_row_level_security = true;
}
$where = CalendarActivity::get_occurs_within_where_clause($call->table_name, $call->rel_users_table, $view_start_time, $view_end_time, 'date_start', $view);
$focus_calls_list = build_related_list_by_user_id($call, $user_id, $where);
foreach ($focus_calls_list as $call) {
if (isset($seen_ids[$call->id])) {
continue;
}
/* BEGIN - SECURITY GROUPS */
require_once "modules/SecurityGroups/SecurityGroup.php";
$in_group = SecurityGroup::groupHasAccess('Calls', $call->id, 'list');
$show_as_busy = !ACLController::checkAccess('Calls', 'list', $current_user->id == $user_id, 'module', $in_group);
$call->show_as_busy = $show_as_busy;
/* END - SECURITY GROUPS */
$seen_ids[$call->id] = 1;
$act = new CalendarActivity($call);
if (!empty($act)) {
$act_list[] = $act;
}
}
}
if ($show_tasks) {
/* BEGIN - SECURITY GROUPS */
// get all upcoming meetings, tasks due, and calls for a user
/**
if(ACLController::checkAccess('Tasks', 'list',$current_user->id == $user_id)) {
*/
if (ACLController::checkAccess('Tasks', 'list', true)) {
//$current_user->id == $user_id)) {
$show_as_busy = !ACLController::checkAccess('Tasks', 'list', $current_user->id == $user_id);
/* END - SECURITY GROUPS */
$task = new Task();
$where = CalendarActivity::get_occurs_within_where_clause('tasks', '', $view_start_time, $view_end_time, 'date_due', $view);
$where .= " AND tasks.assigned_user_id='{$user_id}' ";
$focus_tasks_list = $task->get_full_list("", $where, true);
if (!isset($focus_tasks_list)) {
$focus_tasks_list = array();
}
foreach ($focus_tasks_list as $task) {
/* BEGIN - SECURITY GROUPS */
require_once "modules/SecurityGroups/SecurityGroup.php";
$in_group = SecurityGroup::groupHasAccess('Tasks', $task->id, 'list');
$show_as_busy = !ACLController::checkAccess('Tasks', 'list', $current_user->id == $user_id, 'module', $in_group);
$task->show_as_busy = $show_as_busy;
/* END - SECURITY GROUPS */
$act = new CalendarActivity($task);
if (!empty($act)) {
$act_list[] = $act;
}
}
}
}
usort($act_list, 'sort_func_by_act_date');
//.........这里部分代码省略.........
示例9: listviewACLHelper
function listviewACLHelper(){
$array_assign = parent::listviewACLHelper();
$is_owner = false;
$in_group = false; //SECURITY GROUPS
if(!empty($this->account_name)){
if(!empty($this->account_name_owner)){
global $current_user;
$is_owner = $current_user->id == $this->account_name_owner;
}
/* BEGIN - SECURITY GROUPS */
else {
global $current_user;
$parent_bean = BeanFactory::getBean('Accounts',$this->account_id);
if($parent_bean !== false) {
$is_owner = $current_user->id == $parent_bean->assigned_user_id;
}
}
require_once("modules/SecurityGroups/SecurityGroup.php");
$in_group = SecurityGroup::groupHasAccess('Accounts', $this->account_id, 'view');
/* END - SECURITY GROUPS */
}
/* BEGIN - SECURITY GROUPS */
/**
if( ACLController::checkAccess('Accounts', 'view', $is_owner)){
*/
if( ACLController::checkAccess('Accounts', 'view', $is_owner, 'module', $in_group)){
/* END - SECURITY GROUPS */
$array_assign['ACCOUNT'] = 'a';
}else{
$array_assign['ACCOUNT'] = 'span';
}
$is_owner = false;
$in_group = false; //SECURITY GROUPS
if(!empty($this->opportunity_name)){
if(!empty($this->opportunity_name_owner)){
global $current_user;
$is_owner = $current_user->id == $this->opportunity_name_owner;
}
/* BEGIN - SECURITY GROUPS */
else {
global $current_user;
$parent_bean = BeanFactory::getBean('Opportunities',$this->opportunity_id);
if($parent_bean !== false) {
$is_owner = $current_user->id == $parent_bean->assigned_user_id;
}
}
require_once("modules/SecurityGroups/SecurityGroup.php");
$in_group = SecurityGroup::groupHasAccess('Opportunities', $this->opportunity_id, 'view');
/* END - SECURITY GROUPS */
}
/* BEGIN - SECURITY GROUPS */
/**
if( ACLController::checkAccess('Opportunities', 'view', $is_owner)){
*/
if( ACLController::checkAccess('Opportunities', 'view', $is_owner, 'module', $in_group)){
/* END - SECURITY GROUPS */
$array_assign['OPPORTUNITY'] = 'a';
}else{
$array_assign['OPPORTUNITY'] = 'span';
}
$is_owner = false;
$in_group = false; //SECURITY GROUPS
if(!empty($this->contact_name)){
if(!empty($this->contact_name_owner)){
global $current_user;
$is_owner = $current_user->id == $this->contact_name_owner;
}
/* BEGIN - SECURITY GROUPS */
//contact_name_owner not being set for whatever reason so we need to figure this out
else {
global $current_user;
$parent_bean = BeanFactory::getBean('Contacts',$this->contact_id);
if($parent_bean !== false) {
$is_owner = $current_user->id == $parent_bean->assigned_user_id;
}
}
require_once("modules/SecurityGroups/SecurityGroup.php");
$in_group = SecurityGroup::groupHasAccess('Contacts', $this->contact_id, 'view');
/* END - SECURITY GROUPS */
}
/* BEGIN - SECURITY GROUPS */
/**
if( ACLController::checkAccess('Contacts', 'view', $is_owner)){
*/
if( ACLController::checkAccess('Contacts', 'view', $is_owner, 'module', $in_group)){
/* END - SECURITY GROUPS */
$array_assign['CONTACT'] = 'a';
}else{
$array_assign['CONTACT'] = 'span';
}
return $array_assign;
}
示例10: listviewACLHelper
function listviewACLHelper(){
$array_assign = parent::listviewACLHelper();
$is_owner = false;
$in_group = false; //SECURITY GROUPS
if(!empty($this->parent_name)){
if(!empty($this->parent_name_owner)){
global $current_user;
$is_owner = $current_user->id == $this->parent_name_owner;
}
/* BEGIN - SECURITY GROUPS */
//parent_name_owner not being set for whatever reason so we need to figure this out
else if(!empty($this->parent_type) && !empty($this->parent_id)) {
global $current_user;
$parent_bean = BeanFactory::getBean($this->parent_type,$this->parent_id);
if($parent_bean !== false) {
$is_owner = $current_user->id == $parent_bean->assigned_user_id;
}
}
require_once("modules/SecurityGroups/SecurityGroup.php");
$in_group = SecurityGroup::groupHasAccess($this->parent_type, $this->parent_id, 'view');
/* END - SECURITY GROUPS */
}
/* BEGIN - SECURITY GROUPS */
/**
if(ACLController::checkAccess('Project', 'view', $is_owner)){
*/
if(ACLController::checkAccess('Project', 'view', $is_owner, 'module', $in_group)){
/* END - SECURITY GROUPS */
$array_assign['PARENT'] = 'a';
}else{
$array_assign['PARENT'] = 'span';
}
$is_owner = false;
if(!empty($this->depends_on_name)){
if(!empty($this->depends_on_name_owner)){
global $current_user;
$is_owner = $current_user->id == $this->depends_on_name_owner;
}
}
if( ACLController::checkAccess('ProjectTask', 'view', $is_owner)){
$array_assign['PARENT_TASK'] = 'a';
}else{
$array_assign['PARENT_TASK'] = 'span';
}
return $array_assign;
}