hide script on script include
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago - last edited 5 hours ago
Hi community, do you have insights on how to hide the script section in script include for a particular script include? Only certain role can view the script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Yes, that could be the case.
In that situation, we can perform a total ACL record-level operation to hide it.
I believe this approach will work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago - last edited 2 hours ago
Something like this might solve your problem, though it will hide the Script Include entirely, not just the Script field:
- create a new Application/Scope (e.g. Hidden Code ; let's assume scope x_acme_hs)
- mark the admin role (create one if it does not already exist) for the new Application/scope with option "Application Administrator"
- grant that admin role to the user or users who should have access to the protected Script Include
- (re)create the Script Include in this new Application/Scope (e.g. HidenCodeLib).
- set the Script Include's "Accessible from" to "All application scopes"
- set the Script Include's "Caller Access" to "Caller Tracking" (however if for some reason also want to control which other scope or code may call this hidden Script Include, you could set this to "Caller Restriction")
- set the Script Include's "Protection policy" to "Protected".
- ask one of the users who was given the Application/Scope admin role to mark the Application/Scope with the "Application administration" option.
Afte this only users who have the Application's/Scope's admin role can view that the Script Include even exists.
But the Script Include could still be called freely be other code.
Developers could call the Script Include as they normally would:
var hcl = new x_acme_hs.HidenCodeLib();
gs.debug(hcl.<property>);
hcl.<method>();If the Script Include is already in use, the original Script Include can be made to inherit this hidden Script Include, making existing code work just fine.
E.g. let's assume a global Script Include exists currently, after moving its content into the new hidden Script Include, the original one could be re-created as:
var HidenCodeLib = Class.create();
HidenCodeLib.prototype = Object.extendsObject(x_acme_hs.HidenCodeLib, {
'type': 'HidenCodeLib',
});In this case, code already using the original Script Include would keep working as if nothing happened.
In this way not even admin will be able to see the Script Include.
