Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | mod_adhoc: Remove "mod_" prefix from permission action name | Kim Alvefur | 2023-04-02 | 2 | -3/+3 |
| | | | | Other places doesn't have "mod_" there, why should it here? | ||||
* | plugins: Prefix module imports with prosody namespace | Kim Alvefur | 2023-03-24 | 2 | -4/+4 |
| | |||||
* | Switch to a new role-based authorization framework, removing is_admin() | Matthew Wild | 2022-06-15 | 2 | -28/+19 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We began moving away from simple "is this user an admin?" permission checks before 0.12, with the introduction of mod_authz_internal and the ability to dynamically change the roles of individual users. The approach in 0.12 still had various limitations however, and apart from the introduction of roles other than "admin" and the ability to pull that info from storage, not much actually changed. This new framework shakes things up a lot, though aims to maintain the same functionality and behaviour on the surface for a default Prosody configuration. That is, if you don't take advantage of any of the new features, you shouldn't notice any change. The biggest change visible to developers is that usermanager.is_admin() (and the auth provider is_admin() method) have been removed. Gone. Completely. Permission checks should now be performed using a new module API method: module:may(action_name, context) This method accepts an action name, followed by either a JID (string) or (preferably) a table containing 'origin'/'session' and 'stanza' fields (e.g. the standard object passed to most events). It will return true if the action should be permitted, or false/nil otherwise. Modules should no longer perform permission checks based on the role name. E.g. a lot of code previously checked if the user's role was prosody:admin before permitting some action. Since many roles might now exist with similar permissions, and the permissions of prosody:admin may be redefined dynamically, it is no longer suitable to use this method for permission checks. Use module:may(). If you start an action name with ':' (recommended) then the current module's name will automatically be used as a prefix. To define a new permission, use the new module API: module:default_permission(role_name, action_name) module:default_permissions(role_name, { action_name[, action_name...] }) This grants the specified role permission to execute the named action(s) by default. This may be overridden via other mechanisms external to your module. The built-in roles that developers should use are: - prosody:user (normal user) - prosody:admin (host admin) - prosody:operator (global admin) The new prosody:operator role is intended for server-wide actions (such as shutting down Prosody). Finally, all usage of is_admin() in modules has been fixed by this commit. Some of these changes were trickier than others, but no change is expected to break existing deployments. EXCEPT: mod_auth_ldap no longer supports the ldap_admin_filter option. It's very possible nobody is using this, but if someone is then we can later update it to pull roles from LDAP somehow. | ||||
* | mod_adhoc: Simplify variable references | Kim Alvefur | 2022-03-22 | 1 | -2/+2 |
| | | | | Since commands[node] was already stored in a local a few lines up | ||||
* | adhoc: Include stanza and origin in adhoc event data | Kim Alvefur | 2017-03-06 | 1 | -0/+2 |
| | | | | | This allows easier access to these, which could be useful for all sorts of reasons | ||||
* | Spelling: Fix various spelling mistakes (thanks timeless) | Kim Alvefur | 2022-03-07 | 1 | -1/+1 |
| | | | | | | Words, sometimes I wonder how they even work Maybe I missed something. | ||||
* | adhoc.lib: Tweak to allow using util.error objects | Kim Alvefur | 2021-01-31 | 1 | -1/+1 |
| | | | | | | Since util.stanza supports util.error objects via duck-typing and adhoc errors look enough like util.error objects, they should able to pass as such. This will allow converting adhoc commands to use util.error. | ||||
* | mod_adhoc: Log commands provided at debug level | Kim Alvefur | 2020-11-22 | 1 | -0/+2 |
| | |||||
* | mod_adhoc: Improve permission setting (fix #1482) BC | Kim Alvefur | 2019-12-20 | 2 | -3/+9 |
| | | | | | | | Rename 'user' permission mode to 'any' for clarity, too easily mistaken for what the 'local_user' setting does. It is also removed as a default and made a required argument. | ||||
* | mod_adhoc: Remove unused variable [luacheck] | Kim Alvefur | 2019-12-23 | 1 | -4/+4 |
| | |||||
* | mod_adhoc: Add compat marker for older handling of adhoc items | Kim Alvefur | 2018-10-27 | 1 | -1/+1 |
| | | | | | | | Most modules use the module:provides() API which add the '-provides' suffix. Previously module:add_item() was used. See 58714123f600 | ||||
* | mod_adhoc: Use util.iterators.sorted_pairs() to sort commands | Matthew Wild | 2018-09-21 | 1 | -5/+2 |
| | |||||
* | mod_adhoc: Simplify iq handling by hooking on iq-set/ instead of iq/. | Emmanuel Gil Peyrot | 2018-08-24 | 1 | -20/+18 |
| | |||||
* | mod_adhoc: Remove unused local [luacheck] | Kim Alvefur | 2018-03-06 | 1 | -1/+1 |
| | |||||
* | adhoc.lib: Rename other variable to avoid name clash [luacheck] | Kim Alvefur | 2017-12-12 | 1 | -12/+12 |
| | |||||
* | Backed out changeset 84c117cdd048, broke things | Kim Alvefur | 2017-12-12 | 1 | -4/+4 |
| | |||||
* | mod_adhoc: Rename variable to avoid name clash [luacheck] | Kim Alvefur | 2017-12-05 | 1 | -2/+2 |
| | |||||
* | mod_adhoc/adhoc.lib: Rename variable to avoid name clash [luacheck] | Kim Alvefur | 2017-12-05 | 1 | -4/+4 |
| | |||||
* | mod_adhoc/adhoc.lib: instantiate table with all fields | Kim Alvefur | 2017-03-06 | 1 | -5/+6 |
| | |||||
* | plugins: Explicitly return to halt event propagation (session.send sometimes ↵ | Kim Alvefur | 2015-09-21 | 1 | -2/+4 |
| | | | | does not return true) | ||||
* | mod_lastactivity, mod_legacyauth, mod_presence, mod_saslauth, mod_tls: Use ↵ | Kim Alvefur | 2014-07-04 | 1 | -3/+4 |
| | | | | the newer stanza:get_child APIs and optimize away some table lookups | ||||
* | mod_adhoc: Add local_user permission | Florian Zeitz | 2013-07-24 | 1 | -9/+20 |
| | |||||
* | mod_adhoc: Use mod_disco for disco handling | Florian Zeitz | 2013-07-24 | 1 | -52/+39 |
| | |||||
* | mod_adhoc: Sort commands by node. This guarantees the order remains the same ↵ | Florian Zeitz | 2013-07-24 | 1 | -1/+5 |
| | | | | across restarts etc. | ||||
* | adhoc.lib: Don't build error reply from reply stanza | Kim Alvefur | 2013-07-24 | 1 | -5/+5 |
| | |||||
* | mod_adhoc: Add support for specifying a default action | Florian Zeitz | 2012-08-02 | 1 | -2/+2 |
| | |||||
* | Hopefully inert commit to clean up logging across a number of modules, ↵ | Matthew Wild | 2012-07-23 | 1 | -2/+2 |
| | | | | removing all cases of concatenation when building log messages | ||||
* | adhoc.lib: Make some globals local | Kim Alvefur | 2012-07-18 | 1 | -1/+2 |
| | |||||
* | mod_adhoc, mod_admin_adhoc, mod_announce: Use module:provides() to manage ↵ | Florian Zeitz | 2012-06-12 | 1 | -0/+1 |
| | | | | Ad-Hoc commands | ||||
* | adhoc.lib: Default actions to 'complete' (replacement for rev 52b6901cabb0) | Kim Alvefur | 2012-05-11 | 1 | -0/+1 |
| | |||||
* | Backed out changeset 52b6901cabb0 (to be replaced) | Matthew Wild | 2012-05-11 | 1 | -9/+2 |
| | |||||
* | mod_adhoc: Always allow at least the "complete" action | Florian Zeitz | 2012-04-13 | 1 | -2/+9 |
| | |||||
* | mod_adhoc: Use module:handle_items() | Matthew Wild | 2011-12-10 | 1 | -11/+5 |
| | |||||
* | mod_adhoc: Add support for commands only executable by global administrators | Florian Zeitz | 2011-06-02 | 1 | -6/+9 |
| | |||||
* | Monster whitespace commit (beware the whitespace monster). | Waqas Hussain | 2010-10-16 | 1 | -1/+1 |
| | |||||
* | mod_adhoc: Answer disco#info for node=xmlns_cmd | Florian Zeitz | 2010-10-01 | 1 | -13/+23 |
| | |||||
* | mod_adhoc: remove 0.7 compat code | Florian Zeitz | 2010-09-01 | 1 | -3/+1 |
| | |||||
* | mod_adhoc: Fix passing data to util.dataforms | Florian Zeitz | 2010-09-01 | 1 | -2/+2 |
| | |||||
* | mod_adhoc: Answer disco#info (This is a MUST in XEP-0050) | Florian Zeitz | 2010-08-22 | 1 | -0/+25 |
| | |||||
* | mod_adhoc: Code restructuring | Florian Zeitz | 2010-08-22 | 1 | -8/+6 |
| | |||||
* | mod_adhoc: Add capability to pass data to forms | Florian Zeitz | 2010-07-10 | 1 | -2/+2 |
| | |||||
* | mod_adhoc: Update for new is_admin usage | Matthew Wild | 2010-06-22 | 1 | -3/+1 |
| | |||||
* | mod_adhoc: Scan through list of items on load, in case items have been added ↵ | Matthew Wild | 2010-06-11 | 1 | -1/+10 |
| | | | | before we were loaded | ||||
* | mod_adhoc/adhoc.lib: Add copyright header | Matthew Wild | 2010-06-11 | 1 | -0/+6 |
| | |||||
* | mod_adhoc/adhoc.lib: Handle errors according to XEP | Matthew Wild | 2010-06-11 | 1 | -1/+2 |
| | |||||
* | mod_adhoc: Imported from prosody-modules, thanks Florob! | Matthew Wild | 2010-06-09 | 2 | -0/+145 |