Changing inherited permission on OneDrive file - microsoft-graph-api

I want to change the role of a sharing permission on a OneDrive file from the "write" role it inherited from its parent folder, to "read".
I'm calling the "me/drive/items/item-id/permissions/permission-id endpoing" using a PATCH request. The body of the request is:
{"roles":["read"]}
When I try this, I get a HTTP 400 response, and the body of the reponse is an error of "member does not exist".
I'm wondering if it's possible to change inherited permissions in this way or not?
Thanks

Related

FineUploader Status 406 ASP.NET

I'm using fineuploader in a ASP.NET Web Application in order to upload files. The uploads are working in most cases. The problem is that the upload of a few files is not working, I'm getting status code 406 when the client sends the post request with the file's chunck.
I tried sending files with the same name,similar size and extension as the files that are not working and they worked so it doesnt seem to be an issue with the filename,size or extension.I couldn't find something in common between these files.
I configured the chunck size for 5MB but also tried chaging to 2 MB and 10MB but they also didn't work.
Here is print of the request, can someone identify the problem and how to solve it?
From the requests, it seems to be some problem with the cloudfront or IIS? I don't know much about this.
Edit:
Looking at the IIS logs I found this, it seems the user is '-' for the request that returned 406, is the cs-username '-' because of the 406 or is the request 406 because of the cs-username '-'? If it's the second, what could make the user be lost like this?
The error message 406 means either the mime type in your Accept request header is invalid for IIS or IIS server can't return data via the type in Accept header.
So please check whether IIS->World wide web services->Static Content has been installed. Please ensure the type in Accept header is also valid in IIS manager->site node->Mime Types.
Now that your client only accept application/json, please ensure your your code will return the correct reponse type.
If that's not working, please enable failed request tracing and post detail error messages in the FRT log.
https://learn.microsoft.com/en-us/iis/troubleshoot/using-failed-request-tracing/troubleshoot-with-failed-request-tracing

How to allow user to enter email in QueryString in MVC4?

User will type www.abc.com/Email/abc#abc.com
above code not work, It generates the error,
HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
Most likely causes:
The directory or file specified does not exist on the Web server.
The URL contains a typographical error.
A custom filter or module, such as URLScan, restricts access to the file.
Things you can try:
Create the content on the Web server.
Review the browser URL.
Check the failed request tracing log and see which module is calling SetStatus. For more information, click here.
Please read more here http://perishablepress.com/stop-using-unsafe-characters-in-urls/http://perishablepress.com/stop-using-unsafe-characters-in-urls/.
You should encode # to '%40' and decode it back to # in your MVC action.
To decode you can use encodeURIComponent
http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_encodeuricomponent
you can use UrlDecode on backed http://msdn.microsoft.com/en-us/library/6196h3wt.aspx

Access denied error message when trying to create a shared link to a folder in Box

So following on from my previous question around permissions to add collaborators, I am now having further permissions issues when trying to create a shared link to a folder in Box using the API.
So to confirm, I have the "Manage an enterprise" scope now enabled on the API account.
Here is the error message I am getting back:
{"type":"error","status":403,"code":"access_denied_insufficient_permissions","help_url":"http:\/\/developers.box.com\/docs\/#errors","message":"Access denied - insufficient permission","request_id":"2137493926531843e3c61af"}
Here is the POST data I am sending:
{"shared_link":{"access":"collaborators"}}
Here is the URL that I am sending it to:
https://api.box.com/2.0/folders/1561835651
The folder Id is for a folder I have created using the API, and I am also able to add collaborators to that folder OK, so up until this point, I have all the correct permissions to perform these operations.
So my question is, what else should I be doing? I cannot see any more options against the account to suggest I need more permissions, and the documentation is not clear on what else I need to do to be able to perform this operation.
For CreateSharedLink method, the HTTP action is PUT. If use POST method, it will return 403 sharedlink access_denied_insufficient_permissions error.
-Ivy

Edit Web Part - HTTP 403 Forbidden Error

I have a webpart in a SharePoint 2007 site. This web part is written in object Model code. I am given Full Control to this Site Collection and can access the page with no issue.
When I tried to Edit it by clicking 'Site Actions--> Edit Page', I got the following error
Error:
The website declined to show this webpage- HTTP 403
Most likely causes:
•This website requires you to log in.
What you can try:
Go back to the previous page.
**More information**
This error (HTTP 403 Forbidden) means that Internet Explorer was able to connect to the website, but it does not have permission to view the webpage.
For more information about HTTP errors, see Help.
is that a user control or something like that which is accessing the File System path ?
if yes then you have to use SPSecurity.RunWithElevatedPrivilages(delegate() {}).
Have a look at this
Thanks
I resolved the HTTP 403 Forbidden issue. The root cause of the issue is, in my code has access to the file system on the server,to which the logged in users do not have the access while Editing the web part.
I have used RunWithElevatedPrivileges but only for getting the site info and updating the list. The code reading the config file and logging into the log file does not covered under ElevatedPrivileges.
I included them with Elevated Privileges, the users are able to Edit the web pat. We can also resolve this issue by giving ther read, write permissions to that particular files to 'SERVER\USERS'

get asana project id

I am trying to find out how to get the workspace and project id's from the main web app. I cant seem to find them anywhere.
I am attempting to write a VB.Net app and am trying to get some info out of the API other than 400 Bad request. If I had these id's I might be able to get further
I put app.asana.com/api/1.0/workspaces into a browser (after I had logged into Asana) and it gave me all of my workspace ID's.
The Project ID is most easily found in the URL of your project when using the web interface: https://app.asana.com/0/{PROJECT_ID}/.... It works with API calls such as pointing your browser to https://app.asana.com/api/1.0/projects/{PROJECT_ID}/tasks?assignee=me

Resources