You are here

README.txt in User protect 6

Same filename and directory in other branches
  1. 8 README.txt
  2. 5 README.txt
  3. 7 README.txt
****************************************************
User Protect Module -- README

written by Chad Phillips: thehunmonkgroup at yahoo dot com
****************************************************

This module provides various editing protection for users. The protections can
be specific to a user, or applied to all users in a role. The following protections
are supported:

  -- username
  -- e-mail address
  -- password
  -- status changes
  -- roles
  -- deletion
  -- OpenID identities (both adding and deleting) 
  -- all edits (any accessed via user/X/edit)

When a protection is enabled for a specified user (or the protection is enabled
because the user belongs to a role that has the protection), it prevents the
editing operation in question that anyone might try to perform on the
user -- unless an administrator who is permitted to bypass the protection is
editing the specified user. The module will protect fields by disabling them at
user/X/edit.

User administrators may be configured to bypass specified protections, on
either a global or per-administrator basis.

These protections are valid both when trying to edit the user directly from
their user/X/edit page, or using the mass user editing operations.

The module also provides protection at the paths user/X/edit and user/X/delete,
should anyone try to visit those paths directly.

Note: this module is compatible with the RoleAssign module.

SETTINGS:
At administer -> user management -> userprotect, you'll find the settings for the
module. When the module is initially enabled, the default settings are such:

  -- User administrators bypass all protections.
  -- The root user specifically bypasses all protections.
  -- The anonymous user (uid 0) and root user (uid 1) are protected from all
     edits, deletion, and OpenID operations.
  -- All role protections are disabled.
  -- The 'change own e-mail', 'change own password', and 'change own openid'
     permissions are enabled for authenticated users in the userprotect section
     at administer -> user management -> access control.

This effectively amounts to no protections. It is suggested that you turn off
as many default administrator bypass settings as possible, and set bypass
settings for specific user administrators--this allows you to take advantage
of the status, roles, deletion, openid and edit protections in a meaningful
way. Because of the per-user bypass/protection settings for the anonymous and
root user, this will also begin protecting those users, without compromising
the root user's access to the entire site.

Important note: In order to protect a user from deletion (by visiting
user/X/delete directly) and/or OpenID edits (by visiting user/X/openid
directly), you must enable the 'delete' and/or 'openid' protection specifically.
Enabling 'all account edits' does not enable these protections!

Also note that this module only provides protection against actions via the
website interface--operations that a module takes directly are not protected!
This module should play well with other contributed modules, but there is no
guarantee that all protections will remain intact if you install modules outside
of the drupal core installation.

ADDING PROTECTIONS FOR A SINGLE USER:
This is done at administer -> user management -> userprotect -> protected users.
Any time a user is added for protection, they will initially receive the default
protections enabled at 
administer -> user management -> userprotect -> protection defaults.

ADDING PROTECTIONS FOR ROLES:
This is done at administer -> user management -> userprotect -> protected roles.
Be cautious about adding protections by role, or you can lock out users from
things unintentionally!

In particular, note the if you enable role protections for a specific role, and you
have no bypasses enabled, you've effectively locked out any role editing for
that role by anybody, unless you come back to the settings page and disable
the role protection!

ADDING ADMINISTRATOR BYPASS RULES:
One of the more powerful features of the module are the administrator bypass
settings. Any user that has been granted the 'administer users' permission can
be configured to bypass any protection, either via the default administrator
bypass settings at 
administer -> user management -> userprotect -> protection defaults, or via
a per-administrator setting at 
administer -> user management -> userprotect -> administrator bypass. If a
bypass is enabled for a user administrator, they will be given editing rights on
that protection regardless if it is enabled for a single user or an entire role.

Note that the per-administrator bypass settings override the default bypass
settings.

DEFAULT PROTECTION SETTINGS:
Set the default protections for newly protected users at
administer -> user management -> userprotect -> protection defaults. In
addition, you can enable the auto-protect feature, which will automatically
add the default protections to any newly created user accounts, and set default
bypass options for all user administrators.

HOW THE MODULE DETERMINES A PROTECTION:
In order to properly use User Protect, it's important to understand how the
module determines if a specified field is to be protected. Here is the basic
logic:

  -- If the current user is a user administrator, check if they have per-administrator
     bypass settings. If so, then check to see if they are allowed to bypass the
     protection. If so, then stop the checks and allow editing of the field.

  -- If not, then if the current user is a user administrator, check if the default
     administrator bypass is enabled for the protection in question. If so, then
     stop the checks and allow editing of the field.

  -- If not, check if the user is editing their own account. If so, determine the
     protections for e-mail, password and openid by examining the userprotect
     permissions for 'change own e-mail', 'change own password' and 'change own
     openid', then continue with the rest of the checks below.

  -- If not, check if the protection is set for the individual user being edited.
     If so, then stop the checks here, and prevent editing of the field (this
     effectively means that individual protections override role protections).

  -- If not, then examine all the roles for the user being edited. If any of those
     roles have the protection enabled, then prevent editing of the field.

  -  If not, then allow the field to be edited.

Note: If a user is editing their own account, they are never protected from editing
their own username, e-mail, password or OpenID. Administrators can still limit the
ability of users to change their username via the role-based permission at
administer -> user management -> access control.

File

README.txt
View source
  1. ****************************************************
  2. User Protect Module -- README
  3. written by Chad Phillips: thehunmonkgroup at yahoo dot com
  4. ****************************************************
  5. This module provides various editing protection for users. The protections can
  6. be specific to a user, or applied to all users in a role. The following protections
  7. are supported:
  8. -- username
  9. -- e-mail address
  10. -- password
  11. -- status changes
  12. -- roles
  13. -- deletion
  14. -- OpenID identities (both adding and deleting)
  15. -- all edits (any accessed via user/X/edit)
  16. When a protection is enabled for a specified user (or the protection is enabled
  17. because the user belongs to a role that has the protection), it prevents the
  18. editing operation in question that anyone might try to perform on the
  19. user -- unless an administrator who is permitted to bypass the protection is
  20. editing the specified user. The module will protect fields by disabling them at
  21. user/X/edit.
  22. User administrators may be configured to bypass specified protections, on
  23. either a global or per-administrator basis.
  24. These protections are valid both when trying to edit the user directly from
  25. their user/X/edit page, or using the mass user editing operations.
  26. The module also provides protection at the paths user/X/edit and user/X/delete,
  27. should anyone try to visit those paths directly.
  28. Note: this module is compatible with the RoleAssign module.
  29. SETTINGS:
  30. At administer -> user management -> userprotect, you'll find the settings for the
  31. module. When the module is initially enabled, the default settings are such:
  32. -- User administrators bypass all protections.
  33. -- The root user specifically bypasses all protections.
  34. -- The anonymous user (uid 0) and root user (uid 1) are protected from all
  35. edits, deletion, and OpenID operations.
  36. -- All role protections are disabled.
  37. -- The 'change own e-mail', 'change own password', and 'change own openid'
  38. permissions are enabled for authenticated users in the userprotect section
  39. at administer -> user management -> access control.
  40. This effectively amounts to no protections. It is suggested that you turn off
  41. as many default administrator bypass settings as possible, and set bypass
  42. settings for specific user administrators--this allows you to take advantage
  43. of the status, roles, deletion, openid and edit protections in a meaningful
  44. way. Because of the per-user bypass/protection settings for the anonymous and
  45. root user, this will also begin protecting those users, without compromising
  46. the root user's access to the entire site.
  47. Important note: In order to protect a user from deletion (by visiting
  48. user/X/delete directly) and/or OpenID edits (by visiting user/X/openid
  49. directly), you must enable the 'delete' and/or 'openid' protection specifically.
  50. Enabling 'all account edits' does not enable these protections!
  51. Also note that this module only provides protection against actions via the
  52. website interface--operations that a module takes directly are not protected!
  53. This module should play well with other contributed modules, but there is no
  54. guarantee that all protections will remain intact if you install modules outside
  55. of the drupal core installation.
  56. ADDING PROTECTIONS FOR A SINGLE USER:
  57. This is done at administer -> user management -> userprotect -> protected users.
  58. Any time a user is added for protection, they will initially receive the default
  59. protections enabled at
  60. administer -> user management -> userprotect -> protection defaults.
  61. ADDING PROTECTIONS FOR ROLES:
  62. This is done at administer -> user management -> userprotect -> protected roles.
  63. Be cautious about adding protections by role, or you can lock out users from
  64. things unintentionally!
  65. In particular, note the if you enable role protections for a specific role, and you
  66. have no bypasses enabled, you've effectively locked out any role editing for
  67. that role by anybody, unless you come back to the settings page and disable
  68. the role protection!
  69. ADDING ADMINISTRATOR BYPASS RULES:
  70. One of the more powerful features of the module are the administrator bypass
  71. settings. Any user that has been granted the 'administer users' permission can
  72. be configured to bypass any protection, either via the default administrator
  73. bypass settings at
  74. administer -> user management -> userprotect -> protection defaults, or via
  75. a per-administrator setting at
  76. administer -> user management -> userprotect -> administrator bypass. If a
  77. bypass is enabled for a user administrator, they will be given editing rights on
  78. that protection regardless if it is enabled for a single user or an entire role.
  79. Note that the per-administrator bypass settings override the default bypass
  80. settings.
  81. DEFAULT PROTECTION SETTINGS:
  82. Set the default protections for newly protected users at
  83. administer -> user management -> userprotect -> protection defaults. In
  84. addition, you can enable the auto-protect feature, which will automatically
  85. add the default protections to any newly created user accounts, and set default
  86. bypass options for all user administrators.
  87. HOW THE MODULE DETERMINES A PROTECTION:
  88. In order to properly use User Protect, it's important to understand how the
  89. module determines if a specified field is to be protected. Here is the basic
  90. logic:
  91. -- If the current user is a user administrator, check if they have per-administrator
  92. bypass settings. If so, then check to see if they are allowed to bypass the
  93. protection. If so, then stop the checks and allow editing of the field.
  94. -- If not, then if the current user is a user administrator, check if the default
  95. administrator bypass is enabled for the protection in question. If so, then
  96. stop the checks and allow editing of the field.
  97. -- If not, check if the user is editing their own account. If so, determine the
  98. protections for e-mail, password and openid by examining the userprotect
  99. permissions for 'change own e-mail', 'change own password' and 'change own
  100. openid', then continue with the rest of the checks below.
  101. -- If not, check if the protection is set for the individual user being edited.
  102. If so, then stop the checks here, and prevent editing of the field (this
  103. effectively means that individual protections override role protections).
  104. -- If not, then examine all the roles for the user being edited. If any of those
  105. roles have the protection enabled, then prevent editing of the field.
  106. - If not, then allow the field to be edited.
  107. Note: If a user is editing their own account, they are never protected from editing
  108. their own username, e-mail, password or OpenID. Administrators can still limit the
  109. ability of users to change their username via the role-based permission at
  110. administer -> user management -> access control.