Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Fix typo in Registry : user object is on _pydioObject, not self. Chec…
Browse files Browse the repository at this point in the history
…k for ajxp_readonly to avoid proposing writeable editors.
  • Loading branch information
cdujeu committed Mar 24, 2016
1 parent 056d152 commit e1add8e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions core/src/plugins/editor.pixlr/fake_error_pixlr.php
@@ -0,0 +1,5 @@
<br>
<br>
<br>
<br>
<div align="center" style="font-family:Arial, Helvetica, Sans-serif;font-size:25px;color:#AAA;font-weight:bold;">Error while opening Pixlr editor!</div>
2 changes: 1 addition & 1 deletion core/src/plugins/gui.ajax/res/js/es6/model/Registry.es6
Expand Up @@ -245,7 +245,7 @@ class Registry{
findEditorsForMime (mime, restrictToPreviewProviders){
var editors = [];
var checkWrite = false;
if(this.user != null && !this.user.canWrite()){
if(this._pydioObject.user != null && !this._pydioObject.user.canWrite()){
checkWrite = true;
}
this._extensionsRegistry.editor.forEach(function(el){
Expand Down
Expand Up @@ -72,7 +72,7 @@ Class.create("PydioUI", {
if(!editorData){
var selectedMime = getAjxpMimeType(selectedNode);
var editors = this._pydio.Registry.findEditorsForMime(selectedMime, false);
if(editors.length && editors[0].openable){
if(editors.length && editors[0].openable && !(editors[0].write && selectedNode.getMetadata().get("ajxp_readonly") === "true")){
editorData = editors[0];
}
}
Expand Down

0 comments on commit e1add8e

Please sign in to comment.