WebContent/js/explore/spaces.js
/**
 * Checks the permissions for the current space and hides/shows buttons based on
 * the user's permissions
 * @param perms The JSON permission object representing permissions for the current space
 */
Checks the permissions for the current space and hides/shows buttons based on
the user's permissions
@param perms The JSON permission object representing permissions for the current space
Checks the permissions for the current space and hides / shows buttons based on the user ' s permissions @param perms The JSON permission object representing permissions for the current space
function checkPermissions(perms, id) {
	if (userIsDeveloper) {
		$('.actionList').show();
		return;
	} else if (perms == null) {
		log('no permissions found, hiding action bar');
		$('.actionList').hide();
		return;
	} else {
		$('.actionList').show();
	}
	if (perms.isLeader) {
		createTooltip($('#users tbody'), 'tr', 'leader');
		$('#editSpace').fadeIn('fast');
		$('#editSpacePermissions').fadeIn('fast');
	} else {
		createTooltip($('#users tbody'), 'tr', 'personal');
		$('#editSpace').fadeOut('fast');
		$('#editSpacePermissions').fadeOut('fast');
	}
	log('perms.addSpace=' + perms.addSpace);
	if (perms.addSpace) {
		$('#addSpace').fadeIn('fast');
		$('#uploadXML').fadeIn('fast');
	} else {
		$('#addSpace').fadeOut('fast');
		$('#uploadXML').fadeOut('fast');
	}
	if (perms.addBenchmark) {
		$('#uploadBench').fadeIn('fast');
	} else {
		$('#uploadBench').fadeOut('fast');
	}
	if (perms.addSolver) {
		$('#uploadSolver').fadeIn('fast');
	} else {
		$('#uploadSolver').fadeOut('fast');
	}
	if (perms.addJob) {
		$('#addJob').fadeIn('fast');
		$("#addQuickJob").fadeIn('fast');
		$('#uploadJobXML').fadeIn('fast');
	} else {
		$('#addJob').fadeOut('fast');
		$('#uploadJobXML').fadeOut('fast');
		$("#addQuickJob").fadeOut('fast');
	}
	createTooltip($("#userExpd"),
		null,
		'expd',
		getSinglePermTable('user', perms.addUser, perms.removeUser));
	log('permissions checked and processed');
}
function checkPermissions ( perms , id ) { if ( userIsDeveloper ) { $ ( '.actionList' ) . show ( ) ; return ; } else if ( perms == null ) { log ( 'no permissions found, hiding action bar' ) ; $ ( '.actionList' ) . hide ( ) ; return ; } else { $ ( '.actionList' ) . show ( ) ; } if ( perms . isLeader ) { createTooltip ( $ ( '#users tbody' ) , 'tr' , 'leader' ) ; $ ( '#editSpace' ) . fadeIn ( 'fast' ) ; $ ( '#editSpacePermissions' ) . fadeIn ( 'fast' ) ; } else { createTooltip ( $ ( '#users tbody' ) , 'tr' , 'personal' ) ; $ ( '#editSpace' ) . fadeOut ( 'fast' ) ; $ ( '#editSpacePermissions' ) . fadeOut ( 'fast' ) ; } log ( 'perms.addSpace=' + perms . addSpace ) ; if ( perms . addSpace ) { $ ( '#addSpace' ) . fadeIn ( 'fast' ) ; $ ( '#uploadXML' ) . fadeIn ( 'fast' ) ; } else { $ ( '#addSpace' ) . fadeOut ( 'fast' ) ; $ ( '#uploadXML' ) . fadeOut ( 'fast' ) ; } if ( perms . addBenchmark ) { $ ( '#uploadBench' ) . fadeIn ( 'fast' ) ; } else { $ ( '#uploadBench' ) . fadeOut ( 'fast' ) ; } if ( perms . addSolver ) { $ ( '#uploadSolver' ) . fadeIn ( 'fast' ) ; } else { $ ( '#uploadSolver' ) . fadeOut ( 'fast' ) ; } if ( perms . addJob ) { $ ( '#addJob' ) . fadeIn ( 'fast' ) ; $ ( "#addQuickJob" ) . fadeIn ( 'fast' ) ; $ ( '#uploadJobXML' ) . fadeIn ( 'fast' ) ; } else { $ ( '#addJob' ) . fadeOut ( 'fast' ) ; $ ( '#uploadJobXML' ) . fadeOut ( 'fast' ) ; $ ( "#addQuickJob" ) . fadeOut ( 'fast' ) ; } createTooltip ( $ ( "#userExpd" ) , null , 'expd' , getSinglePermTable ( 'user' , perms . addUser , perms . removeUser ) ) ; log ( 'permissions checked and processed' ) ; }
Checks the permissions for the current space and hides/shows buttons based on
 the user's permissions
 @param perms The JSON permission object representing permissions for the current space
Checks the permissions for the current space and hides / shows buttons based on the user ' s permissions @param perms The JSON permission object representing permissions for the current space
// Check for no permission and hide entire action list if not present
 // Don't hide if user is developer
 // attach leader tooltips to every entry
 // Otherwise only attach a personal tooltip to the current user's entry in the userTable
 // Create tooltips for the expd class
