forked from CORE-POS/IS4C
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
member edit auth_class and mod fixes
- Loading branch information
Showing
4 changed files
with
17 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34cec0d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RE: member permissions:
I currently have three levels:
End User Manual - Data Stewards / DBA / IT CORE-POS/IS4C#2 might be my own personal quirk, but I could End User Manual - Cashier CORE-POS/IS4C#1 and Developer Documentation CORE-POS/IS4C#3 being useful in the standard set of permissions.
34cec0d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I've done so far is add three auth_classes for those levels, with the intent of replacing the current "editmembers" and possibly "memgen":
0 login if $must_authenticate, but no auth_class
1 members_view
2 members_edit_partial
3 members_edit_full
I've assigned $auth_classes at the lowest level the user must have to the pages in fannie/mem/:
0 MemberIndexPage - the menu of Member operations
1 MemberSearchPage - the Search/Find form and the hitlist it displays for >1 hit
1 MemberEditor - Display the record and edit.
But how to keep a user with only level 1 from Saving changes? Should the Save button be suppressed? Should all the inputs be readonly, or rendered as text rather than inputs? A message somewhere "You don't have permission to change?"
And, do you not allow level 2 to edit MemberType? If you don't, what would be the idomatic to prevent that? The MemberModule class does not have access to $auth_classes or the other authentication apparatus of FanniePage.
The separate pages that are linked to from the Active Status, Equity and AR modules are children of FanniePage:
3 MemStatusEditor
For the Equity and AR changes in correction_pages/*.php is level 3 enough, or should it be something like admin?
3? MemberTypeEditor. Is level 3 enough for changing member types?
3? NewMemberTool . Currently has the special "memgen" priv, but level-3 seems enough to me, and retire memgen.
1 numbers/MemberStickerPage. Little harm possible I think
0? import/MemImportIndex - The import sub-menu
3? For the import/*.php themselves, is 3 high enough?
34cec0d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't grasp the distinction between 0 and 1. Are the inter-related - i.e., level 1 only applies if must_authenticate is in use?
The member modules can certainly call validateUserQuiet() in ShowEditForm or SaveFormData (or both) to change behavior based on the current user's permissions. I think that's the only way to have that level of fine tuning. I think it's present already otherwise auth/login.php can be included.
I agree with your suggested levels for the rest. People with level-3 permissions are presumably fairly trusted and none of the tools can cause any irreparable damage. Any mistake with status or the correction pages can easily be reversed. The worst thing NewMemberTool can do is create a whole bunch of empty memberships. MemberTypeEditor could make a bit of a mess, but unless the structure is ludicrously complicated someone ought to be able to fix it from memory (and in any event the member structure is probably documented in policy somewhere).
34cec0d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AT>I don't grasp the distinction between 0 and 1. Are the inter-related - i.e., level 1 only applies if must_authenticate is in use?
EL>No,
0 means if must_authenticate but auth_classes =="" then login is still required, but no special privs, any logged-in user can see.
So you can see the menu but probably can't run anything that's on it.
1 means login + members_view
Fine re trustworthinness of 3. A lot of those functions we don't use yet so I wasn't sure about the level of privacy, trust.
Can you comment on my questions under MemberEditor? Maybe MemberModule class should have a Display function that just renders text, not a form. Or maybe I don't understand what you mean about view-only, or I'm over-complicating things. I just don't want to lose a nuance you rely on.
34cec0d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was picturing something like this for member modules:
Then further down it could draw input boxes or just text based on $edit_level. The zero/one level doesn't fit into this scheme though because the module would have to know about the must_authenticate setting.
Maybe MemberModule::ShowEditForm needs to take an additional argument - i.e., ShowEditForm($memNum, $countryCode, $editLevel) and the MemberEditor class should do all the permission checks. So the above would become something like this: