SyteLine中文社区-Infor Cloudsuite Industrial Business ERP

 找回密码
 注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

搜索
查看: 1185|回复: 2

[表单开发] 转莫总发:查询某个表单有哪些用户有操作权限

[复制链接]
  • TA的每日心情
    慵懒
    2019-6-24 14:26
  • 签到天数: 5 天

    [LV.2]偶尔看看I

    61

    主题

    156

    帖子

    1389

    积分

    版主

    Rank: 7Rank: 7Rank: 7

    积分
    1389

    开拓者

    发表于 2016-7-5 14:47:44 | 显示全部楼层 |阅读模式
    本帖最后由 托托 于 2016-7-5 14:52 编辑

    莫总说: 用得到的朋友拿去
    [SQL] 纯文本查看 复制代码
    SELECT DISTINCT 
      Username, UserDesc,GroupName,ObjectName1, DeletePrivilege,
      EditPrivilege, ExecutePrivilege, InsertPrivilege, ReadPrivilege, 
      UpdatePrivilege, BulkUpdatePrivilege
    FROM (SELECT dbo.UserNames.Username, UserDesc,AccountAuthorizations_1.ObjectName1,
                 AccountAuthorizations_1.DeletePrivilege, AccountAuthorizations_1.EditPrivilege, 
                 AccountAuthorizations_1.ExecutePrivilege, AccountAuthorizations_1.InsertPrivilege,
                 AccountAuthorizations_1.ReadPrivilege, 
                 AccountAuthorizations_1.UpdatePrivilege, AccountAuthorizations_1.BulkUpdatePrivilege,GroupName
          FROM dbo.GroupNames AS GroupNames_2 
          INNER JOIN dbo.UserGroupMap ON GroupNames_2.GroupId = dbo.UserGroupMap.GroupId 
          INNER JOIN dbo.AccountAuthorizations AS AccountAuthorizations_1 ON GroupNames_2.GroupId = AccountAuthorizations_1.Id 
          RIGHT OUTER JOIN dbo.UserNames ON dbo.UserGroupMap.UserId = dbo.UserNames.UserId
          WHERE (AccountAuthorizations_1.UserFlag = 0) AND (AccountAuthorizations_1.ObjectType = 0)
          UNION
          SELECT UserNames_1.Username,UserDesc, AccountAuthorizations_1.ObjectName1, 
                 AccountAuthorizations_1.DeletePrivilege, AccountAuthorizations_1.EditPrivilege, 
                 AccountAuthorizations_1.ExecutePrivilege, AccountAuthorizations_1.InsertPrivilege,
                 AccountAuthorizations_1.ReadPrivilege, 
                 AccountAuthorizations_1.UpdatePrivilege, AccountAuthorizations_1.BulkUpdatePrivilege,'' as GroupName
          FROM dbo.AccountAuthorizations AS AccountAuthorizations_1 
          INNER JOIN dbo.UserNames AS UserNames_1 ON AccountAuthorizations_1.Id = UserNames_1.UserId
          WHERE     (UserFlag = 1) AND (ObjectType = 0)) AS a
    where ObjectName1='MiscellaneousIssue'
    ORDER BY Username, ObjectName1
    


  • TA的每日心情

    2019-4-3 12:29
  • 签到天数: 12 天

    [LV.3]偶尔看看II

    1

    主题

    19

    帖子

    243

    积分

    注册会员

    Rank: 2

    积分
    243
    发表于 2018-9-5 09:14:35 | 显示全部楼层
    查出来是空白的.....
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    无聊
    2019-6-25 13:46
  • 签到天数: 5 天

    [LV.2]偶尔看看I

    0

    主题

    13

    帖子

    141

    积分

    注册会员

    Rank: 2

    积分
    141
    发表于 2019-1-3 15:07:53 | 显示全部楼层
    不要只是抄代码,要理解才行呀。
    后面的Where条件里面查询了某个表单的,如果你的环境里没有使用到这个表单,当然查出来的是空白的。
    回复 支持 反对

    使用道具 举报

    您需要登录后才可以回帖 登录 | 注册

    本版积分规则

    小黑屋|手机版|Archiver|SyteLine中文社区 ( 沪ICP备13030789号  

    GMT+8, 2019-10-15 00:23 , Processed in 0.546585 second(s), 43 queries .

    Powered by Discuz! X3.2

    © 2001-2013 Comsenz Inc.

    快速回复 返回顶部 返回列表