以演示账套中的数据为例:
用户【李想】拥有【生产管理_生产排程】里的【工艺模型】对象中的所有明细权限;
列表左侧
select FObjectType,* from t_ObjectType where FName = '生产管理_生产排程';
select FObjectType,FObjectID,* from t_ObjectType where FObjectType = 5440 and FName = '工艺模型'
右侧列表权限明细项
select * from t_ObjectAccessType a
where a.FObjectType = 5440 and a.FObjectID = 1
然后t_user表中查找李想的ID 16465
判断李想是否有工艺模型的权限
select case when a.FAccessMask = (a.FAccessMask & b.FAccessMask) then 'Y' else 'N' end ,a.* from t_ObjectAccessType a
inner join t_AccessControl b on a.FObjectType = b.FObjectType and a.FObjectID = b.FObjectID
where a.FObjectType = 5440 and a.FObjectID = 1 and (FUserID =16465 or FUserID in (Select FGroupID From t_Group where FUserID = 16465))
--有些权限是按组给的,所有会有or之后的条件
完
推荐阅读