Dissable document note deletion

OpenKM has many interesting features, but requires some configuration process to show its full potential.
Forum rules
Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
Post Reply
andrei.gherghe
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: Tue Nov 14, 2017 2:59 pm

Dissable document note deletion

Post by andrei.gherghe » Tue Nov 14, 2017 3:06 pm

Hello guys.
Does anyone know how I can dissable the posibility for users to delete their own document notes? It is okay if admins can do it, even preferable, but I don't want users to be able do to this and cover their traks if they comment that they approve on something or say they verified something and then change their minds and get others in trouble.

I've searched online for a solution and apparently deleting notes is a new'ish' feature. I've found out it's configured in NoteModule.java but I don't know how to dissable it.

Really appreciate the help :!:

jllort
Moderator
Moderator
Posts: 9702
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: Dissable document note deletion

Post by jllort » Thu Nov 16, 2017 4:42 pm

Might be done in several ways:
1- Add new event linked with note deletion and then based in some logic do nothing or raise exception
2- Modify de UI ( does not allow deleting except for administrator ). This will be a path only for you because this behaviour is only good for you.
3- Extends security mask for new privilege ( does not allow to delete or modify notes )

If you have JAVA skills, I can guide you on how doing it. Choose what you prefer.

andrei.gherghe
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: Tue Nov 14, 2017 2:59 pm

Re: Dissable document note deletion

Post by andrei.gherghe » Thu Nov 16, 2017 5:23 pm

Hello jillort!
Actually, after talking more with my team i came to another conclusion. (P.S. before going forward, we disabled deleting notes from the profiles, that's fixed).
Now we have the issue with users being able to edit their comments. I found nothing online, but came to this possible solution that i want to try tomorow:

1. Unarchive OpenKM.war

2. locate Notes.class and delete it

3. modify the source code (https://github.com/openkm/document-mana ... Notes.java) and change line 318 from true to false.

4. compile it to Notes.class and paste it in the unarchived .war

5. archive back the .war and replace it on the server

Do you think that would do it?

I'm not great with java, could you help me modify it so that instead of checking if the user is the owner of the comment check if the user has 'ROLE_ADMIN" set? I'm talking about line 316.

Thanks alot!

jllort
Moderator
Moderator
Posts: 9702
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: Dissable document note deletion

Post by jllort » Sat Nov 18, 2017 10:44 am

It will not working, you must checkout the git project and compile full, why ? because OpenKM UI interface is based in GWT technology that means while compiling it is generate javascript output what's really the UI ( GWT converts JAVA classes to Javascripts ones in compilation time ), that why changing any class into frontend/* will not take any effect

You can also add a profile parameter to disable note edition ( this is quite easy to be done ) and we can merge with actual code ( for it you should fork the project and after you have done the modification ask for a merge request from your new branch to our 6.3-DEV )

You have the code here
https://github.com/openkm/document-management-system

We are nearly to share a virtual machine what comes with everything into ( development environment from community ). Last week we had uploaded into Amazon S3 but still we have not published the url for downloading ( we need some few test before official, but I think is near to be released ).

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest