How to restrict visibility of some metadata?

cancel
Showing results for 
Search instead for 
Did you mean: 
upforsin
Senior Member

How to restrict visibility of some metadata?

Jump to solution

Hello

Is it possible to restrict the visibility of some content's metadata only for some groups

For example, the top-secret property should only be visible to Site Managers, not Consumers.

howkymike
Alfresco Developer
1 Solution

Accepted Solutions
abhinavmishra14
Advanced

Re: How to restrict visibility of some metadata?

Jump to solution

May be a hint, you can create your own edit-mode, create-mode, view-mode or field type based  freemarker templates and use it in the form config. I dont have full solution yet but this is something which can be tried.

From config reference: https://docs.alfresco.com/5.2/references/forms-reference.html

From within the template, you can call a repository webscript to get the permission ([ALLOWED|DENIED];[USERNAME|GROUPNAME];PERMISSION') for current user and show/hide control based on response.

Example of calling a repo ws from ftl file:

<script type="text/javascript">//<![CDATA[
    var checkPermission = function(res){
        var result = eval('(' + res.serverResponse.responseText + ')');
        // process the response and set any flag for hiding and showing control.
    }

Alfresco.util.Ajax.jsonGet({
    url : Alfresco.constants.PROXY_URI + "/getPermission?currentUser="+user,
    successCallback : {
        fn : checkPermission,
        scope : this
    },
    failureCallback : {
        fn : function() {},
        scope : this
    }
});
//]]></script>

 

 

~Abhinav
(ACSCE, AWS SAA, Azure Admin)

View solution in original post

4 Replies
EddieMay
Alfresco Employee

Re: How to restrict visibility of some metadata?

Jump to solution

Hi @upforsin

I believe you can set the 'field-visibility' in share-config-custom.xml. There's an example here.  

HTH

Digital Community Manager, Alfresco Software.
Problem solved? Click Accept as Solution!
upforsin
Senior Member

Re: How to restrict visibility of some metadata?

Jump to solution

Hi @EddieMay 

As far as I know (doc), using 'field-visibility' I can hide/show the property for everyone. What if I want to show it only for some groups?

howkymike
Alfresco Developer
EddieMay
Alfresco Employee

Re: How to restrict visibility of some metadata?

Jump to solution

Hi @upforsin 

Apologies, I skipped over the group requirement. There is a post on a related requirement that might be of interest.

Xenit have a commercial solution that alllows you to "Apply fine-grained mandatory-access-controls based on user-roles and document metadata" - whether this is just for access control or includes control over Share "show/hide" behaviour I don't know.

Digital Community Manager, Alfresco Software.
Problem solved? Click Accept as Solution!
abhinavmishra14
Advanced

Re: How to restrict visibility of some metadata?

Jump to solution

May be a hint, you can create your own edit-mode, create-mode, view-mode or field type based  freemarker templates and use it in the form config. I dont have full solution yet but this is something which can be tried.

From config reference: https://docs.alfresco.com/5.2/references/forms-reference.html

From within the template, you can call a repository webscript to get the permission ([ALLOWED|DENIED];[USERNAME|GROUPNAME];PERMISSION') for current user and show/hide control based on response.

Example of calling a repo ws from ftl file:

<script type="text/javascript">//<![CDATA[
    var checkPermission = function(res){
        var result = eval('(' + res.serverResponse.responseText + ')');
        // process the response and set any flag for hiding and showing control.
    }

Alfresco.util.Ajax.jsonGet({
    url : Alfresco.constants.PROXY_URI + "/getPermission?currentUser="+user,
    successCallback : {
        fn : checkPermission,
        scope : this
    },
    failureCallback : {
        fn : function() {},
        scope : this
    }
});
//]]></script>

 

 

~Abhinav
(ACSCE, AWS SAA, Azure Admin)