Restrict visibility of custom aspect

cancel
Showing results for 
Search instead for 
Did you mean: 
Lvit
Member II

Restrict visibility of custom aspect

Hi,

i have some documents with custom aspect (many properties). I want show this custom aspect only for specific user group, and hide this aspect for other users.

There is a way to do this?

Alternatively, there is other way to show some document's metadata only for specific users?

Thanks

2 Replies
cristinamr
Advanced

Re: Restrict visibility of custom aspect

Hi!

Related with metadata visibility by groups.

I hope this post can help you.

Cheers,

Cris.

--
VenziaIT: helping companies since 2005! Our ECM products: AQuA & Seidoc
afaust
Master

Re: Restrict visibility of custom aspect

The linked post is a (rather low-level) way of dealing with restricted visibility. What you can always do is use the Surf Extension module system to differentiate visibility of metadata via configuration, since Surf Extension modules can be deployed / activated specifically based on the groups of which the current user is a member. Using Surf Extension modules, you can define one module with a metadata form configuration that applies to all groups, and a second module with an "add-on" form configuration that only applies to a specific group of privileged users. Alfresco Share merges form configurations at runtime from all the valid sources (static global config as well as extension modules) to build an effective config based on the current user.

In one customer project e.g. I have the following config for something similar:

<?xml version='1.0' encoding='UTF-8' ?>
<extension>
    <modules>
        <module>
            <id>${moduleId} - Extensions</id>
            <description>${project.name} - Extensions</description>
            <version>${noSnapshotVersion}</version>
            <auto-deploy>true</auto-deploy>

            <configurations>
                <config evaluator="node-type"
                    condition="acme:content">
                    <forms>
                        <form id="doclib-simple-metadata">
                            <appearance>
                                <field id="cm:taggable">
                                    <control>
                                        <control-param name="createNewItemUri"></control-param>
                                        <control-param name="createNewItemIcon"></control-param>
                                    </control>
                                </field>
                            </appearance>
                        </form>
                    </forms>
            </configurations>
        </module>

        <module>
            <id>${moduleId} - Admin Extensions</id>
            <description>${project.name} - Admin Extensions</description>
            <version>${noSnapshotVersion}</version>
            <auto-deploy>true</auto-deploy>
            
            <evaluator type="group.module.evaluator">
                <params>
                    <groups>GROUP_ALFRESCO_ADMINISTRATORS</groups>
                    <relation>OR</relation>
                </params>
            </evaluator>

            <configurations>
                <config evaluator="node-type"
                    condition="acme:content">
                    <forms>
                        <form id="doclib-simple-metadata">
                            <appearance>
                                <field id="cm:taggable">
                                    <control>
                                        <control-param name="createNewItemUri">/api/tag/workspace/SpacesStore</control-param>
                                        <control-param name="createNewItemIcon">tag</control-param>
                                    </control>
                                </field>
                            </appearance>
                        </form>
                    </forms>
                </config>
            </configurations>
        </module>
    </modules>
</extension>

to disable the ability to create new tags in a form for non-admins, and re-allow it for admins.