32 return "data:image/svg+xml;utf8,<svg class=\"menuIcon\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 32 32\"><g id=\"acl\"><rect x=\"3.36\" y=\"3.38\" width=\"25.67\" height=\"7.09\"/><ellipse fill=\"rgb(255,255,255)\" class=\"iconWhite\" cx=\"6.48\" cy=\"7.09\" rx=\"1.38\" ry=\"1.34\"/><rect fill=\"rgb(27,186,217)\" class=\"iconColor\" x=\"8.79\" y=\"4.59\" width=\"18.92\" height=\"4.68\" rx=\"2.34\" ry=\"2.34\"/><rect x=\"3.37\" y=\"11.84\" width=\"25.67\" height=\"7.09\"/><ellipse fill=\"rgb(255,255,255)\" class=\"iconWhite\" cx=\"6.48\" cy=\"15.55\" rx=\"1.38\" ry=\"1.34\"/><rect fill=\"rgb(27,186,217)\" class=\"iconColor\" x=\"8.79\" y=\"13.05\" width=\"18.92\" height=\"4.68\" rx=\"2.34\" ry=\"2.34\"/><rect x=\"3.38\" y=\"20.3\" width=\"25.67\" height=\"7.09\"/><ellipse fill=\"rgb(255,255,255)\" class=\"iconWhite\" cx=\"6.49\" cy=\"24.01\" rx=\"1.38\" ry=\"1.34\"/><rect fill=\"rgb(27,186,217)\" class=\"iconColor\" x=\"8.8\" y=\"21.5\" width=\"18.92\" height=\"4.68\" rx=\"2.34\" ry=\"2.34\"/></g></svg>";
39 a[
"type"] =
"openLayout";
51 r->
_metadata[
"type"] =
"aclEditor:aclEditor.js";
60 for (
int i=0;i<l.length();i++)
69 for (
int i=0;i<mounts.length();i++)
71 if (mounts[i]->isMounted())
75 a[ mounts[i]->path()+
"/__ACL__" ] =
true;
81 o[
"readwrite"] = readwrite;
82 r->
_data.setObject(o);
97 if (libname ==
"aclEditor.js")
100 if (libname ==
"aclEditor.css")
114 addACLFeature( acl,
"readwrite",
true,
"Allow editing ACL values.\n\nIt is recommended to set the default value to false once admin groups have been added.");
118 r->
_data.setObject(acl);
static bool checkAllowAccess(VFS_session *s, QString path, QString feature="")
Check if a session has access to a resource.
static QStringList fetchACLPaths()
Fetch the VFS path to each registered ACL file.
A common base class for all things that want to act like an application or include ACL support.
void addACLFeature(QJsonObject &acl, QString feature, bool value, QString description="")
Add a feature to the acl object.
static QString code(QString nodename, QString libname, QString &error)
Fetch code or any other resource from a node.
void addACLFeatureGroup(QJsonObject &acl, QString feature, QString group, bool value)
Add a feature group to the acl object.
void addACLDefault(QJsonObject &acl, bool value, QString description="")
Add a default value to the acl object.
The base class for all requests between nodes.
bool _success
if the request was successfully completed
QJsonDocument _data
the request payload
QJsonObject _metadata
the request payload
static QList< VFS_tcp_mount * > _mounts
The list of existing mounts.
static QMutex _mountsLock
A mutex for modifying the _mounts entry.
virtual void metadata(VFS_request *r)
Fetch the metadata of this node.
virtual QByteArray icon()
Fetch the application icon.
virtual void aclDefaults(VFS_request *r)
Return default values and features associated wth this node.
virtual bool isContainer()
A VFS_node may have children.
virtual void read(VFS_request *r)
Return the data contents of this node, or if it's a container call ls()
static QString code(QString nodename, QString libname, QString &error)
Fetch code from this node.
QJsonObject jsonResource(QString resource, bool *ok=nullptr)
Fetch the contents of a Qt resource as a QJsonObject.
QByteArray resourceContents(QString resource, bool *ok=nullptr, bool squashHash=false)
Fetch the contents of a Qt resource file.