提交 ed53fbeb 编写于 作者: U unknown

前台api中增加listGroupWithIdentity

上级 dee211e3
......@@ -19,6 +19,7 @@ MWF.xScript.Actions.UnitActions = new Class({
listSupGroupDirect: invoke("listSupGroupDirect"),
listSupGroupNested: invoke("listSupGroupNested"),
listGroupWithPerson: invoke("listGroupWithPerson"),
listGroupWithIdentity: invoke("listGroupWithIdentity"),
groupHasRole: invoke("groupHasRole"),
//角色--------
......
......@@ -9,6 +9,7 @@
//data: {"personList":[]}
"listGroupWithPerson": {"uri": "/jaxrs/group/list/person/object", "method": "POST"}, //人员所在群组(嵌套)
"listGroupWithIdentity": {"uri": "/jaxrs/group/list/identity/object", "method": "POST"}, //人员所在群组(嵌套)
//data: {"group":"","roleList":[""]}
"groupHasRole": {"uri": "/jaxrs/group/has/role", "method": "POST"}, //群组是否拥有角色
......
......@@ -218,6 +218,21 @@ MWF.xScript.CMSEnvironment = function(ev){
// orgActions.listGroupWithPerson(data, function(json){v = json.data;}, null, false);
// return v;
},
//身份所在群组(嵌套)--返回群组的对象数组
listGroupWithIdentity:function(identity, async){
getOrgActions();
var data = {"identityList": getNameFlag(identity)};
var v = null;
var cb = function(json){
v = json.data;
if (async && o2.typeOf(async)=="function") return async(v);
return v;
};
var promise = orgActions.listGroupWithIdentity(data, cb, null, !!async);
return (!!async) ? promise : v;
},
//群组是否拥有角色--返回true, false
groupHasRole: function(name, role, async){
getOrgActions();
......
......@@ -767,6 +767,21 @@ MWF.xScript.Environment = function(ev){
// orgActions.listGroupWithPerson(data, function(json){v = json.data;}, null, false);
// return v;
},
//身份所在群组(嵌套)--返回群组的对象数组
listGroupWithIdentity:function(identity, async){
getOrgActions();
var data = {"identityList": getNameFlag(identity)};
var v = null;
var cb = function(json){
v = json.data;
if (async && o2.typeOf(async)=="function") return async(v);
return v;
};
var promise = orgActions.listGroupWithIdentity(data, cb, null, !!async);
return (!!async) ? promise : v;
},
//群组是否拥有角色--返回true, false
groupHasRole: function(name, role, async){
getOrgActions();
......
......@@ -294,6 +294,21 @@ if (!MWF.xScript || !MWF.xScript.PageEnvironment) {
// orgActions.listGroupWithPerson(data, function(json){v = json.data;}, null, false);
// return v;
},
//身份所在群组(嵌套)--返回群组的对象数组
listGroupWithIdentity:function(identity, async){
getOrgActions();
var data = {"identityList": getNameFlag(identity)};
var v = null;
var cb = function(json){
v = json.data;
if (async && o2.typeOf(async)=="function") return async(v);
return v;
};
var promise = orgActions.listGroupWithIdentity(data, cb, null, !!async);
return (!!async) ? promise : v;
},
//群组是否拥有角色--返回true, false
groupHasRole: function (name, role, async) {
getOrgActions();
......
......@@ -2143,6 +2143,48 @@ MWF.xScript.ViewEnvironment = function (ev) {
// orgActions.listGroupWithPerson(data, function(json){v = json.data;}, null, false);
// return v;
},
//身份所在群组(嵌套)--返回群组的对象数组
/**
* 根据身份标识获取所有的群组对象数组。如果群组具有群组(group)成员,且群组成员中包含该身份,那么该群组也被返回。
* @method listGroupWithIdentity
* @o2membercategory group
* @methodOf module:org
* @static
* @param {IdentityFlag|IdentityFlag[]} identity - 身份的distinguishedName、id、unique属性值,身份对象,或上述属性值和对象的数组。
* @param {(Boolean|Function)} [asyncOrCallback] 当参数为boolean,表示是否异步执行,默认为false。当参数为function,表示回调方法。
* @return {Promise|GroupData[]} 当async为true时,返回
* {@link https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Promise|Promise}。
* 否则返回群组对象数组。
* @o2ActionOut x_organization_assemble_express.GroupAction.listGroupWithIdentity|example=Group
* @o2syntax
* //同步执行,返回群组数组。
* var groupList = this.org.listGroupWithIdentity( identity );
*
* //异步执行,返回Promise对象
* var promise = this.org.listGroupWithIdentity( identity, true);
* promise.then(function(groupList){
* //groupList 为返回的群组数组。
* })
*
* //异步执行,在回调方法中获取群组
* this.org.listGroupWithPerson( identity, function(groupList){
* //groupList 为返回的群组数组。
* })
*/
listGroupWithIdentity:function(identity, async){
getOrgActions();
var data = {"identityList": getNameFlag(identity)};
var v = null;
var cb = function(json){
v = json.data;
if (async && o2.typeOf(async)=="function") return async(v);
return v;
};
var promise = orgActions.listGroupWithIdentity(data, cb, null, !!async);
return (!!async) ? promise : v;
},
//角色***************
//获取角色--返回角色的对象数组
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册