• Hide or limit "restore" and "compact history" in "History" page

  • OpenKM has many interesting features, but requires some configuration process to show its full potential.
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.
 #42177  by han
 
Hi all,

I have a question about this:
Anyone who can see the "History" page that can "restore" any version and use "comact history" to delete the other versions.
Can I do something to hide or limit these for some group(role or profile) ?
Or I can only limit anyone else can't see "History" tab?

Should any body please help on these?
Many thanks!
 #42179  by jllort
 
You can extend security http://wiki.openkm.com/index.php/Applic ... d_security ( and then indicate who can doing it and who cannot ). Another option is modifying source code ( better add in profiles ) for showing or not the option based on profiles ( if you want we can guide on it ). Another option should be disabling "versions" from profile ( all version history tab will be hidden ).
 #42186  by jllort
 
First add the option in the profiles, take a look at:
* ProfileServlet.java
* profile_misc.jsp ( I suggest add in misc tab )
* ProfileMisc.java

Then propagate to UI. Take a look at:
* WorkspaceServlet.java
* GWTWorkspace.java ( should add here the new variable ).
* TabDocument.java -> VersionScrollTable.java ( this is the class of history ) should hide the button ( take a look at class WorkspaceUserProperties line 287 for understanding how doing it ).
 #42193  by han
 
Thanks for your reply,jllort.

I have never learned java, but I will try it these days.
First I need to decompile "ProfileServlet.class" and "ProfileMisc.class" to get "ProfileServlet.java" and "ProfileMisc.java". Is it right?
 #42200  by han
 
Thank you first,jllort.

I edit the VersionScrollTable.java from
Code: Select all
if (result.size() > 1 ) {
	purge.setEnabled(true);
} else {
	purge.setEnabled(false);
}
to
Code: Select all
if (result.size() > 1 && Main.get().workspaceUserProperties.getWorkspace().isAdminRole()) {
	purge.setEnabled(true);
} else {
	purge.setEnabled(false);
}
I tried to compile "VersionScrollTable.java" by javac, but it can't.
I think that should compile by other way, but I really have no idea about it.
Or what I edit above gets something wrong ? (Only admin role can use purge.)
What can I do to replace VersionScrollTable.class (or others) in my openKM 6.3.1 by it?
 #42216  by han
 
Thanks for your reply, jllort

I learning how to compile project to a ".war" file these days.

I downloaded the OpenKM portabal edition ,and edited "VersionScrollTable.java" as above.

And I compiled openKM in eclipse by
"right click openkm-6.3-community 8185 >> run as >> Maven built >> Build openkm 6.3 war:clean gwt:compile compile install".

After compile,I stop the openKM on my computer and I copy the openKM.war from my VirtualMachine to my computer, and replace it by the new one.

Then I start up openKM, but it does still not work when I loggin as a "user" that doesn't have admin role.
(not work: When I loggin as a user that doesn't have admin role, I can still use compact history.)

Does I do something wrong with it?
 #42227  by jllort
 
The portable edition comes with a tomcat, there you should deploy the application before testing in your production environment.
Portable edition also comes with portable firefox with what you are able to debug UI ( take a look here http://wiki.openkm.com/index.php/Debugging_with_GWT )
 #42391  by han
 
Thank you jllort,

After I downloaded the portable edition, I edited "VersionScrollTable.java".

Using "purge.setEnabled(false);" to let the "compact history" bottom unavilable.

And I try it in the portable edition, it works well in the portable version.

But I don't know how to let it work in openKM 6.3.1.

(I compiled openKM in eclipse by
"right click openkm-6.3-community 8185 >> run as >> Maven built >> Build openkm 6.3 war:clean gwt:compile compile install".
And I copied openKM.war from the portable edition to openKM.
Then, I deleted the openKM folder that in "tomcat/webapps/".
After these steps, I start up openKM, But it does not work the same as it works in the portable edition.
Did I miss something? Or it can only works in the portable edition?
What should I do?)
 #42405  by jllort
 
Which OpenKM did you have at the begining ? 6.3.x ? which version ?
Ensure, you copied the OpenKM.com file from the eclipse workspace no ?

Basically should be like a migration.
Stop OpenKM
set OpenKM hibernate.hbm2ddl=update ( optional, only if you are jumping to upper version )
copy new OpenKM.war into webapps
remove folder /webapps/OpenKM ( to ensure new clean deployin )
remove work/Catalina/localhost folder ( same reason )
start OpenKM

There's no reason why it's running from portable and not from deployed.
 #42411  by han
 
jllort wrote:Which OpenKM did you have at the begining ? 6.3.x ? which version ?
Version 6.3.1
jllort wrote:Ensure, you copied the OpenKM.com file from the eclipse workspace no ?
8185
jllort wrote:Basically should be like a migration.
Stop OpenKM
set OpenKM hibernate.hbm2ddl=update ( optional, only if you are jumping to upper version )
copy new OpenKM.war into webapps
remove folder /webapps/OpenKM ( to ensure new clean deployin )
remove work/Catalina/localhost folder ( same reason )
start OpenKM

There's no reason why it's running from portable and not from deployed.
Many thanks jllort :D ,

It's solved.
I stop openKM
copy new OpenKM.war into webapps
remove folder /webapps/OpenKM
copy new openKM folder into webapps (from EclipsePortable\Data\workspace\openkm-6.3-community\target)
remove work/Catalina/localhost folder
start openKM

and clean the browser(IE, chrome, firefox etc)
( Using some browser that is before clean, I can still log in and do "compact history". )

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.