[GeoNetwork-users] Changing configuration of default privileges set at record creation - GN v2.10.2

Hi,

Is there a way to change the default privileges that are automatically set
when a metadata record is created using GN's editor?

By default "Publish" and "Notify" are checked for the Group selected when
creating the record. Can the system be configured to instead (for example)
check "Publish" and "Editing" for the Group selected?

We want to avoid a user to having to do this manually.

Any help much appreciated.

Many Thanks

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Changing-configuration-of-default-privileges-set-at-record-creation-GN-v2-10-2-tp5099759.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.

Hi Shireeb

The permissions are set in Java code, so not easy to change unless rebuild
GeoNetwork (see DataManager.copyDefaultPrivForGroup).

The metadata create services accepts a param fullPrivileges, that is not
used by default. You can change xsl/metadata-create.xsl to add it:

<form id="createform" name="createform" accept-charset="UTF-8"
action="{/root/gui/locService}/metadata.create" method="post">
* <input type="hidden" name="fullPrivileges" value="true" />*
This will make that the metadata gets all the permissions for the group
where is created. No fine grain permission selection (unless Java changes),
but better than the bizarre default permissions assigned for view and
notify. Possibly there's a reason for these default permissions, but I
can't see it.

Regards,
Jose García

On Thu, Jan 23, 2014 at 11:57 PM, shireeb <s.brockie@anonymised.com> wrote:

Hi,

Is there a way to change the default privileges that are automatically set
when a metadata record is created using GN's editor?

By default "Publish" and "Notify" are checked for the Group selected when
creating the record. Can the system be configured to instead (for example)
check "Publish" and "Editing" for the Group selected?

We want to avoid a user to having to do this manually.

Any help much appreciated.

Many Thanks

--
View this message in context:
http://osgeo-org.1560.x6.nabble.com/Changing-configuration-of-default-privileges-set-at-record-creation-GN-v2-10-2-tp5099759.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.

http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at
http://sourceforge.net/projects/geonetwork

--

* GeoCat Bridge for ArcGIS allows instant publishing of data and metadata
on GeoServer and GeoNetwork. Visit http://geocat.net
<http://geocat.net/&gt; for details. _________________________Jose
GarcíaGeoCat bvVeenderweg 13 6721 WD BennekomThe
Netherlandshttp://GeoCat.net/> *

Thanks very much for your help Jose.

We have changed xsl/metadata-create.xsl as suggested. However unfortunately
newly created records, using GN’s editor, are still being assigned the View
and Notify privileges only for the Group and not all of the permissions.

If possible could you please take a look at the change we made below and let
me know if you spot anything wrong? In case it makes a difference we are
using the HTML5UI.

<xsl:template name="template-form">
                <form id="createform" name="createform"
accept-charset="UTF-8" action="metadata.create" method="post">
                        <input type="hidden" name="fullPrivileges"
value="true"/>

Regards shireeb

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Changing-configuration-of-default-privileges-set-at-record-creation-GN-v2-10-2-tp5099759p5100329.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.

Success. Thanks to Jose. For html5ui instructions please refer below.

/Hi

Using the HTML5UI indeed makes a difference, as not using the previous xslt
(thats for the classic UI), the HTML5UI is build in javascript using ExtJs.
For this change I'm afraid you need to download the sourcecode to rebuild at
least the UI module (as javascript code is minified).

The HTML5UI is in the web-client module and the code to change should be
this:

https://github.com/geonetwork/core-geonetwork/blob/2.10.x/web-client/src/main/resources/apps/html5ui/js/App.js#L286

Change:
editorPanel.init(metadataId, create, group, child);

To:
  editorPanel.init(metadataId, create, group, child, false, true);

The last parameter is the fullPrivileges (See method API in
https://github.com/geonetwork/core-geonetwork/blob/2.10.x/web-client/src/main/resources/apps/js/GeoNetwork/lib/GeoNetwork/widgets/editor/EditorPanel.js#L819)

Once you change the code, execute mvn clean install in web-client module.

When finishes the build in html5ui folder
web-client/src/main/resources/apps/html5ui/js you should have App-mini.js,
that should contain the change and should replace in your installation.

Regards,
Jose García/

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Changing-configuration-of-default-privileges-set-at-record-creation-GN-v2-10-2-tp5099759p5101657.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.