20 , _authPaths(authPaths.split(
","))
21 , _sessionsPath(sessions+
"/sessions")
23 _authPaths.replaceInStrings(QRegExp(
"\\s+(.*)"),
"\\1");
24 _authPaths.replaceInStrings(QRegExp(
"(.*)\\s+"),
"\\1");
56 return "data:image/svg+xml;utf8,<svg class=\"menuIcon\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 32 32\"><g id=\"ldap\"><path fill=\"rgb(255,255,255)\" class=\"iconWhite\" d=\"M27.92,16.07a11.16,11.16,0,0,0-3.14-.85,4.45,4.45,0,0,1-5.44,0c-5.88.9-7,4.62-7,9.06H23.93c.17-.16.35-.31.52-.48A11.46,11.46,0,0,0,27.92,16.07Z\"/><ellipse fill=\"rgb(255,255,255)\" class=\"iconWhite\" cx=\"22.03\" cy=\"9.9\" rx=\"4.89\" ry=\"5.49\"/><path fill=\"rgb(27,186,217)\" class=\"iconColor\" d=\"M12.71,15.22a4.45,4.45,0,0,1-5.44,0,10.52,10.52,0,0,0-3.18,1,11.46,11.46,0,0,0,3.46,7.62c.17.17.35.32.52.48H19.7C19.7,19.82,19,16.07,12.71,15.22Z\"/><ellipse fill=\"rgb(27,186,217)\" class=\"iconColor\" cx=\"9.97\" cy=\"9.9\" rx=\"4.89\" ry=\"5.49\"/><ellipse cx=\"16.23\" cy=\"13.18\" rx=\"4.89\" ry=\"5.49\"/><path d=\"M19,18.5a4.45,4.45,0,0,1-5.44,0c-3.84.59-5.66,2.38-6.46,4.78.16.17.31.35.48.52A11.53,11.53,0,0,0,16,27.34a11.51,11.51,0,0,0,8.45-3.5,13.15,13.15,0,0,0,.91-1C24.57,20.63,22.82,19,19,18.5Z\"/></g></svg>";
71 a[
"type"] =
"openLayout";
81 r->
_metadata[
"type"] =
"sessionsList:sessionsList.js";
88 { r->
_reason =
"No authpaths found. Can't list users.";
125 r->
_reason =
"sessions: invalid or no authindex present.";
128 int i = r->
_metadata.value(
"authindex").toInt();
165 if (libname ==
"sessionsList.js")
168 if (libname ==
"sessionsList.css")
184 addACLFeature( acl,
"terminate",
false,
"Allow termination of user sessions.");
187 addACLFeature( acl,
"manage",
false,
"Allow management of user session data.");
190 addACLFeature( acl,
"showall",
false,
"Show all users, not just those that have a session.");
194 r->
_data.setObject(acl);
static bool checkAllowAccess(VFS_session *s, QString path, QString feature="")
Check if a session has access to a resource.
A common base class for all things that want to act like an application or include ACL support.
virtual VFS_request * createRequest(VFS_request::requestType type, QString path, QString user="unknown", QJsonDocument data=QJsonDocument(), QJsonObject metadata=QJsonObject(), bool dontDelete=false)
Create a new VFS_request with this object as _origin.
virtual void issueRequest(VFS_request *t)
A convenience function.
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.
virtual void receiveResponse(VFS_request *t)
Once a VFS_request has been completed, a response will be issued back to its _origin.
The base class for all requests between nodes.
@ ls
list children of a node (1)
virtual void setCallback(VFS_request *c)
Chain a callback onto this request.
requestType _requestType
the action this request is performing or requesting
QString _initialPath
the target path when the request was made (relative to the responder)
QString _user
who initiated this request, mostly for logging
VFS_session * _session
The session associated with this request. This is an optional value, and care should be taken to chec...
QString _reason
if something (probably bad) happened, this is the reason
QString _path
the target path remnant... the remaining path element once the request has found its target
QList< notifyException > _notifyExceptions
a list of nodes not to send responses to for this transaction. For instance if a node submits to a no...
bool _success
if the request was successfully completed
QJsonDocument _data
the request payload
virtual VFS_request * getCallback(VFS_node *receiver)
Create and chain a VFS_request for a receiver.
VFS_request * _callback
request to execute once this request completes
QJsonObject _metadata
the request payload
QStringList _authPaths
The VFS_auth paths to report on.
bool isContainer()
This always returns false.
virtual void aclDefaults(VFS_request *r)
Return the ACL defaults for this node.
virtual void metadata(VFS_request *r)
Fetch the metadata of this node.
virtual void initialize()
Initialize the sessions application.
Q_INVOKABLE sessionsList(QString authPaths, QString sessions)
The sessions constructor.
virtual QByteArray icon()
Return the users icon from VFS_icons.
virtual void receiveResponse(VFS_request *t)
Receive a response from an issued VFS_request.
virtual void read(VFS_request *r)
Return the data contents of this node, or if it's a container call ls()
QString _sessionsPath
The VFS_sessions to report for active logins.
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.