Can I change the read/write permissions for a notebook/section/page using the OneNote API? - onenote

The POST and GET actions on /notebooks have a userRole property that indicates if the user can perform read/write operations on a Notebook. I'd like to change this programmatically to allow things like sharing notebooks with other users. I've looked through the documentation but haven't found anything that lets me change the userRole for a notebook, section or page.
Is such a thing possible?

Unfortunately, there is no API to do that right now. If you would like to suggest that this be added, please go to the OneNote API Uservoice site to vote: https://onenote.uservoice.com/forums/245490-onenote-apis

Related

BIM 360 Project Creation, Template Duplicate Folders (Update Request)

Related to this 2-year-old question: BIM 360 Project creation template
Is there still not a way to replicate the Web UI option "Activate Document Management" -> "Apply a project template" that duplicates folder structure and role-based permissions?
Specifically, I'm looking at requests to create a project
POST projects https://forge.autodesk.com/en/docs/bim360/v1/reference/http/projects-POST/ supplying a template_project_id value
and then activate with
POST users/import v2 https://forge.autodesk.com/en/docs/bim360/v1/reference/http/projects-project_id-users-import-POST/
I don't see any other template input in the API documentation besides the first request, and that does not appear to bring folder structure along.
unfortunately, what you found is correct currently, creating a project from a template with folder structure and role permission is not supported with current API, but you can achieve that by yourself as shown in a sample project at https://github.com/Autodesk-Forge/forge-bim360.project.setup.tool.
This is actually a high requested wish HQ-5023 as you can see at https://fieldofviewblog.wordpress.com/2019/06/15/bim-360-acc-api-known-issues-and-wishes/#more-4424 , our engineering is actively working on that, we will update you at our blog if any progress.
Based on reading the documentation, and running some tests, this appears to be unavailable still. I would very much like to be proven incorrect by someone at Autodesk! Thanks.

Is there a way to list who viewed a file (and when)?

I'm searching for a little while and I can't find what I'm looking for, so it may be a good idea to ask it here.
Is there a way to obtain, by API, for a specific file, the name of the last user (and timestamp) who accessed a file?
Goal: to write to script to know who access what on my drive.
Unfortunately, what you want cannot be achieved. The Drive Activity API is used only for retrieving the activity on the specified file. You can gather the users who have view access but not the ones who have actually viewed the file.
The action object from the Drive Activity API is represented by the action detail. For a document at the moment, the action details are the following: create, edit, move, rename, delete, restore, permissionChange, comment, dlpChange, reference, settingsChange. Therefore, taking these into account as well, you cannot see who viewed a file.
Since the option of seeing the actual viewers of a file is still a relatively new feature in the UI, the option for the API does not yet exist.
What you can do instead is to file a feature request on Issue Tracker by accessing this link here.
Reference
Drive Activity API
You can use the Drive Activity API.

Programmatically Setting Custom Permissions for Google Sites Pages

I'm currently creating a Google Site for staff where I work. We would like each staff member to have their own page that only they can view with details such as rota's, shift itinerary etc. We would not like other members of staff be able to view this. The current idea I have for implementing this is to run a script that generates a page for each user with the custom permissions set so only editors and themselves can view it. However, although I am aware you can set site wide permissions through Google Scripts, I can not find a way to set page wide custom permissions programmatically.
Is anyone aware of a way I can do this or if there is an alternative way to achieve the same goal?
Many thanks
Check out the following link:
https://code.google.com/a/google.com/p/apps-api-issues/issues/detail?id=2934
And also check out the following link (check comment #15):
https://code.google.com/p/google-apps-script-issues/issues/detail?id=1021
(comment #15): A work around you can use is to add a group with the permissions you require and then from Apps Script you can programmatically add/remove people from the group.
If you want Google engineers to develop this functionality then vote for this issue on the above link.

How can i share a wirecloud marketplace between users

I built some widgets and uploaded on my local marketplace, is there a way to share that?
And better is it possible to share a Mashup (the widget composition) without giving the
possibility to wiring to the user?
I mean the user should use an application layout without change anything.
You can make public your workspaces/dashboards following the steps documented in the user guide. Only the owner of a workspace will be able to modify it. I think this is what are you searching for.
Another option is to create a packaged mashup using the "Upload to my resources" option in the editor view:
Take a look to the "Advanced" tab, where you can block widgets (make them unremovable), block connections (make wiring connections unremovable) and embed used widgets/operator (by default packaged mashups depends on the user having installed all the required widgets/operators. This way you can distribute the widgets and operators used by the mashup in the same package).
However, take into account that this method is meant for sharing mashup templates, the user will always be able to add additional widgets and create new connections in the wiring view.
Once packaged, mashups/dashboards (and widgets and operators) can be uploaded to a WStore server (e.g. to the Store portal provided on FIWARE Lab) for sharing them with other users. The steps for making this is also described in the WireCloud's user guide.
I have the problem, revisited.
I have set up a working Marketplace instance (v2.3) but am unable to integrate it with Wirecloud. The marketplace is correctly registered but all the requests i am making to this Marketplace are throwing 502 error, even though i am actually able to see some results when querying the Marketplace server through a browser.
Indicatively, i can issue a GET command at http://:8080/FiwareMarketplace/v1/registration/stores/ and get an answer, but Wirecloud's internal APIs return a 502 (Bad Gateway).
Any idea on what might have gone wrong?
PS: This happens for WC v0.6.5. When upgrading to a newer (Beta) version of WC, everything seems to be performing as expected, i.e. the marketplace is correctly inserted and the stores are correctly retrieved and processed.

Login, create folder and upload file to Box account as service account

I reviewed the Box authentication documentation as well as the other StackOverflow questions but I'm still unable to find definite answer.
My client is an enterprise Box client and would like to build a company's internal web application that would login into Box.com using service/admin account and create folder and upload a file. The uploaded folder will be available to specific customer that will login into Box and upload additional files.
I created a sequence diagram to depict the same.
Would you let me know if this is a supported Box authentication model? Can the Box 2.0 Beta API Token be used to login as service account and create file/folder/share?
Thanks for your help!
There are several options that could work for you. Let me suggest the simplest one first, and if that is not sufficient, then I can suggest other ways to accomplish your goal.
You can use the regular Box authentication for your solution. To do so, simply get an API key and an auth-token for your application. Then, after you have uploaded your file, use the V2 API to create a shared link for your file. You can email that shared link to the client, and they can use the link to access the file.
there has been new developments since this question was posted, and now it's possible to use JWT (JSON Web Token) and Box Developers Edition to access Box.
If you create a developer account you will be able to create App users and login using an enterprise id and a private key file. Check out the docs for more information: Box Developer Edition
Additonally, boxsdk comes with support for Box Developer Edition