Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce list mode and permissions #13

Closed
noyainrain opened this issue Mar 9, 2018 · 2 comments
Closed

Introduce list mode and permissions #13

noyainrain opened this issue Mar 9, 2018 · 2 comments

Comments

@noyainrain
Copy link
Owner

Introduce a list mode which indicates how users work with a list and for that defines permissions, i.e. what users can do and the privileges of list owners.

A concept is available as part of the list feature draft.

@noyainrain noyainrain changed the title List mode and permissions Introduce list mode and permissions Jan 8, 2019
@noyainrain
Copy link
Owner Author

Draft:

For now only collaborate and view mode and the currently implemented actions are relevant, the rest is for future reference.

class List:
    """
    .. describe:: mode

       List mode, describing how users work with the list. In ``collaborate`` mode, users
       collaborate on the list. In ``contribute`` mode, users contribute (items) to the list. In
       ``view`` mode, users only view the list.

       The following permissions apply:

       * ``collaborate``: Authenticated users may modify [1]_ the list and create, manage [2]_ and
         modify [3]_ items
       * ``contribute``: Authenticated users may create items. Item owners may modify [3]_ their
         items.
       * ``view``: None

       List owners always have full permissions.

       .. [1]: Edit, trash and restore the list and move items
       .. [2]: Edit tags of, check, uncheck and assign items
       .. [3]: Edit, trash and restore items
   """

    # _PERMISSIONS = {
    #     'collaboration': {
    #         'item-owner': {                                    'item-manage', 'item-modify'},
    #         'user ':      {'list-modify', 'list-items-create', 'item-manage', 'item-modify'}
    #     },
    #     'contribution': {
    #         'item-owner': {                                                   'item-modify'},
    #         'user ':      {               'list-items-create',                             }
    #     },
    #     'view': {
    #         'item-owner': {},
    #         'user ':      {}
    #     }
    # }

class Item:
    def check(): # ...
        """
        Permission: See :ref:`List` *mode*.
        """

UI draft:

@noyainrain
Copy link
Owner Author

Depends on noyainrain/micro#60.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant