lib/services/ObjectService.js
function(roleName)
	{
        var app = this;
		var role = {permissions:[]};
		try
		{
            if(app.roles.hasOwnProperty(roleName)){
                role = app.roles[roleName];
            }else{                
                throw "not found";
            }
		}
		catch(e)
		{
			var objFilePath = path.join(app._path,"roles",roleName);
			if(fs.existsSync(objFilePath+".js"))
			{
				var roleConfig = require(objFilePath);
                if(typeof app.roles != "object") app.roles={};
				app.roles[roleName]= roleConfig.permissions;                    
                if(roleConfig.hasOwnProperty('isDefault') && roleConfig.isDefault == true){
                    app.defaultRoles.push(roleName);
                }
                role = roleConfig.permissions;
			}
		}
		return role;
	}
function(roleName)
	{
        var app = this;
		var role = {permissions:[]};
		try
		{
            if(app.roles.hasOwnProperty(roleName)){
                role = app.roles[roleName];
            }else{                
                throw "not found";
            }
		}
		catch(e)
		{
			var objFilePath = path.join(app._path,"roles",roleName);
			if(fs.existsSync(objFilePath+".js"))
			{
				var roleConfig = require(objFilePath);
                if(typeof app.roles != "object") app.roles={};
				app.roles[roleName]= roleConfig.permissions;                    
                if(roleConfig.hasOwnProperty('isDefault') && roleConfig.isDefault == true){
                    app.defaultRoles.push(roleName);
                }
                role = roleConfig.permissions;
			}
		}
		return role;
	}
function ( roleName ) { var app = this ; var role = { permissions : [ ] } ; try { if ( app . roles . hasOwnProperty ( roleName ) ) { role = app . roles [ roleName ] ; } else { throw "not found" ; } } catch ( e ) { var objFilePath = path . join ( app . _path , "roles" , roleName ) ; if ( fs . existsSync ( objFilePath + ".js" ) ) { var roleConfig = require ( objFilePath ) ; if ( typeof app . roles != "object" ) app . roles = { } ; app . roles [ roleName ] = roleConfig . permissions ; if ( roleConfig . hasOwnProperty ( 'isDefault' ) && roleConfig . isDefault == true ) { app . defaultRoles . push ( roleName ) ; } role = roleConfig . permissions ; } } return role ; }
Get specified openbiz pre-defined system role.

This method it part of {@link openbiz.objects.Application},
please never call this directly by ObjectService.

if need to call this method, you have to use javascript's function.apply(applicationPointer,params)
please see sample
@memberof openbiz.services.ObjectService
@param {string} roleName - The specified system role name
@returns {array.<string>} Array of permission names,
the permission could be used by {@link openbiz.policies.ensurePermission} middle-ware for protect resource access
@example
//below code is how to get the role named "cubi-admin"
//cubiApp is instance of openbiz.objects.Application
var cubiAdmin = app.getRole("cubi-admin");

//cubiAdmin will looks like below
// [
//   "cubi-user-manage",
//   "cubi-contact-manage",
//   "cubi-account-manage"
// ]
@example
//if you want to call this method directly , please try this way
require('openbiz/services/ObjectService').getRole.apply(applicationPointer,roleName)
Get specified openbiz pre - defined system role .