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 mechanism to hide API modules and/or actions from the API listing page #6042

Closed
mattab opened this issue Aug 21, 2014 · 6 comments
Closed
Labels
Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement. Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.

Comments

@mattab
Copy link
Member

mattab commented Aug 21, 2014

The goal of this ticket is to provide an easy way for plugin developers to hide some API modules and actions from the API listing page.

The API listing page is the page that is available via top user Menu > API link.

Tasks:

Add new annotations:

Note:

  • Currently in an API file in Piwik it is already possible to tag a module with @ignore or a given API function. When they are tagged this way, the API is not callable via the Web API endpoint and is not displayed in the API listing page.

What do you think?

@mattab mattab added this to the Short term milestone Aug 21, 2014
@mattab mattab added the Task label Aug 21, 2014
@quba
Copy link
Contributor

quba commented Aug 21, 2014

Sounds good for me.

@mattab
Copy link
Member Author

mattab commented Aug 21, 2014

Maybe we don't need @hide actually, and we could only implement @hideExceptForSuperUser -> I've removed it from the ticket description.

(if a method is not supposed to be called it should be in a model and not public I reckon)

@diosmosis
Copy link
Member

I think a more general solution would be to add a @apiVisibility annotation. It would require a access level argument (ie, 'superuser' or 'admin'). So,

@apiVisibility superuser

@quba
Copy link
Contributor

quba commented Sep 3, 2014

admin means that user has admin access to at least one site?

@mattab
Copy link
Member Author

mattab commented Sep 3, 2014

I think it's better to keep it simple in this case and only provide hiding for Super user (for super admin and maintenance type APIs), and otherwise always display the API in the listing.

@mattab
Copy link
Member Author

mattab commented Dec 1, 2014

@hideExceptForSuperUser now works to hide API from the API page, except when user is Super User. done in #6382

@mattab mattab closed this as completed Dec 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement. Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Projects
None yet
Development

No branches or pull requests

3 participants