1. 程式人生 > >ServiceNow 中的權限設置

ServiceNow 中的權限設置

需要 顯示 類型 https 實例 box 有時 this ble

所謂權限控制,無非就是限制系統中的部分用戶增刪改查表或者字段的過程。 在新建一個table時,我們會看到一個 ‘Create access controls’和’User role‘ ,如下圖: ![](https://s1.51cto.com/images/blog/201901/09/ee4a41d5a51dba5700e54a915878916e.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=) 勾選了’Create access controls‘後,需要新建或是選擇一個已有的角色。 引用官方文檔的介紹: ”Create access controls:Select the check box and then complete the User role field to create basic security rules for the table“ ”User role: Enter a new name or select an existing user role that is required to access this table. This option is available only when the Create access controls check box is selected.“ 很好理解,這個帶有這個 role 的 user 才可以 控制該表。 每一個table ,都對應的可以設置自身的ACL ACL的Role required: security_admin 具體的設置方法與說明請參考官方文檔: https://docs.servicenow.com/bundle/kingston-platform-administration/page/administer/contextual-security/concept/acl-rule-types.html ok,下面說下遇到的問題的總結。 在實例開發中,如果沒有role的 user不能查看相關數據,而admin或其他role的user可以查看到,那麽我們就肯定可以斷定,是table或者table裏的field設置了ACL。 Example 1: 在某些list中,普通user看不到部分record,說明該user不滿足這部分record的ACL裏面的role設置或者condition設置。 Example 2: 在form中,普通user看不到部分Fields,同上,該user不滿足field相應的ACL。 Example 3: 有時候,user明明可以看到field,卻查看不到該field的值。這種情況,一般是因為該field是Reference類型,需要從其他table查詢數據,所以,對應的是user不滿足Reference的table的相應的ACL. 分享一個案例: Portal裏的table list 裏對於普通user始終無法顯示A field 的值。但是後臺系統的table list 卻能顯示這個field的值, 又因為沒有對A field設置特殊的ACL,所以理論上應該所有人都可以read,但事實在portal的widget查詢數據後,怎麽都顯示不出來。最後發現A field是Reference類型,於是我去查看了reference對應的table的ACL,果然是普通user不滿足這個ACL。

ServiceNow 中的權限設置