添付ファイルの削除をユーザーによって管理したい

Potemi
Tera Contributor

テーブルのレコードにファイルを添付できますが、添付ファイルを削除できる人、できない人を区別することはできますか。現在、添付ファイルの削除ボタンをユーザーロールによって管理することはできますか。

 

Potemi_0-1703149095488.png

 

 

4 REPLIES 4

Sohail Khilji
Kilo Patron
Kilo Patron

in English please ?


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

I can attach files to records in a table, but can I distinguish between who can and can't delete attachments? We are currently considering whether the delete attachment button can be managed by user role. Please let me know if there is any other good way to do it.

 

Yes you can control it by creating a business rule as like below :

 

 

Name: Restrict Delete attachment on RITM
Table: sys_attachment
Advanced: check
When: Before
Delete: check


Filter Condition: Table Name is sc_req_item or any other table you want to restrict

Script Conditon:

(function executeRule(current, previous /*null when async*/) {

// Add your code here

if(!gs.hasRole('admin')){

current.setAbortAction(true);

}
})(current, previous);

 


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

Dustin Mustain
Tera Contributor

 Google translate:  I can attach files to records in a table, but can I differentiate between who can and cannot remove attachments? Is it currently possible to control the delete attachment button by user role?