<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Get file permissions in Vault Customization Forum</title>
    <link>https://forums.autodesk.com/t5/vault-customization-forum/get-file-permissions/m-p/13375653#M169</link>
    <description>&lt;P&gt;I am sorry for leading you in the wrong direction with the consumable state; this is irrelevant as you are not downloading a file for edits rather than updating metadata only. Anyway, I would recommend using this cascade:&lt;/P&gt;
&lt;P&gt;- Check that the file is not cloaked (means it is read accessible as a minimum, and to avoid subsequent calls to fail)&lt;/P&gt;
&lt;P&gt;- Check that the file is not locked by leveraging the EntityStatusImageInfo Lockstate. (it will return a reliable result of any life cycle state, not only for states having the Obsolete/Released flag)&lt;/P&gt;
&lt;P&gt;- check that the file is available for check-out. An unlocked file that another user has not checked out should be available.&lt;BR /&gt;I hope having clarified now. I appreciate your patience.&lt;/P&gt;</description>
    <pubDate>Mon, 17 Mar 2025 17:06:55 GMT</pubDate>
    <dc:creator>Markus.Koechl</dc:creator>
    <dc:date>2025-03-17T17:06:55Z</dc:date>
    <item>
      <title>Get file permissions</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/get-file-permissions/m-p/13366368#M162</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is it possible to check, if a specific user has the write permission for a specific file it its current life cycle state?&lt;/P&gt;&lt;P&gt;I'm writing a C# add-in for Vault Professional 2023 and I would like to check if a user is allowed to edit a file or not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ppauleSHGR6_0-1741771474715.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1476810i446F3D4AA454BA7C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ppauleSHGR6_0-1741771474715.png" alt="ppauleSHGR6_0-1741771474715.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For my general understanding, I need to check several things:&lt;/P&gt;&lt;P&gt;1. Is the user directly listed in the security tab of the lifecylce state?&lt;/P&gt;&lt;P&gt;2. Is the user member of a group which is listed in the security tab of the lifecycle state?&lt;/P&gt;&lt;P&gt;3. Is the group "Everyone" listed&amp;nbsp;in the security tab of the lifecycle state?&lt;/P&gt;&lt;P&gt;4. Does the found group/user permission have the write permission?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wasn't able to find a way how to access these permission for a specific lifecylce state.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is very much appreciated.&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 12 Mar 2025 09:29:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/get-file-permissions/m-p/13366368#M162</guid>
      <dc:creator>ppauleSHGR6</dc:creator>
      <dc:date>2025-03-12T09:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: Get file permissions</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/get-file-permissions/m-p/13366415#M163</link>
      <description>&lt;P&gt;What is the primary objective to be solved? Should we add a check that the current user can edit the file in general? You could achieve this for any lifecycle and state without knowing the particular behavior configuration.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) Check that the file is not cloaked (this means the file is not only returned by the API but also visible for the current user).&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;// Autodesk.DataManagement.Client.Framework.Vault.Currency.Entities Namespace &amp;gt; FileIteration Class : IsCloaked Property
mFileIt.IsCloaked == false&lt;/LI-CODE&gt;
&lt;P&gt;2) Check that the file is available for check-out or has already been checked out to the current user.&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;                    EntityStatusImageInfo mStatus = conn.PropertyManager.GetPropertyValue(mFileIt, mVaultStatus, null) as EntityStatusImageInfo;
                    if (mStatus.Status.ConsumableState == EntityStatus.ConsumableStateEnum.LatestConsumable)
                    {
                        // start the edits
                    }&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Mar 2025 09:55:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/get-file-permissions/m-p/13366415#M163</guid>
      <dc:creator>Markus.Koechl</dc:creator>
      <dc:date>2025-03-12T09:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: Get file permissions</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/get-file-permissions/m-p/13368513#M164</link>
      <description>&lt;P&gt;Hi Markus and thanks for your reply.&lt;/P&gt;&lt;P&gt;My overall goal is to check if the currently logged-in User is allowed to edit document properties via the "&lt;EM&gt;IExplorerUtil&lt;/EM&gt;".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have this code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Connection connection = new Connection(m_serviceManager, vaultName, m_serviceManager.AuthService.Session.User.Id, serverName, AuthenticationFlags.AutodeskAuthentication);
IExplorerUtil m_vaultExplorer = ExplorerLoader.LoadExplorerUtil(serverName, vaultName, m_serviceManager.AuthService.Session.User.Id, connection.Ticket);
m_vaultExplorer.UpdateFileProperties(file, propertyValues);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I want to catch all cases that could cause the function "&lt;EM&gt;UpdateFileProperties&lt;/EM&gt;" to fail before it is called.&lt;/P&gt;&lt;P&gt;Does it make more sense to work with try/catch and handle the different exception types and error codes?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I decided for this approach since I am working in an interface application which is transferring item data from an ERP system to Vault and also tries to update file properties if the item has a linked model and/or drawing and my experience with the "&lt;EM&gt;UpdateFileProperties&lt;/EM&gt;" method is, that it only throws a very general exception that just says something like "Properties could not be updated", but never gives me a specfic error code or reason.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2025 09:46:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/get-file-permissions/m-p/13368513#M164</guid>
      <dc:creator>ppauleSHGR6</dc:creator>
      <dc:date>2025-03-13T09:46:22Z</dc:date>
    </item>
    <item>
      <title>Re: Get file permissions</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/get-file-permissions/m-p/13368544#M165</link>
      <description>&lt;P&gt;It makes sense to pro-actively handle the availability for edits before calling a property update instead of using try/catch. But instead of evaluating all behavior settings, validating that the current user can check out for edits is more efficient. You could do this as suggested in my previous answer; it will return detailed information why a file is not available for check-out/property update.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2025 09:58:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/get-file-permissions/m-p/13368544#M165</guid>
      <dc:creator>Markus.Koechl</dc:creator>
      <dc:date>2025-03-13T09:58:16Z</dc:date>
    </item>
    <item>
      <title>Re: Get file permissions</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/get-file-permissions/m-p/13370696#M166</link>
      <description>&lt;P&gt;Appreciate your reply, thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I looked up everything about the &lt;EM&gt;EntityStatus&lt;/EM&gt; class and still have questions about it.&lt;/P&gt;&lt;P&gt;I understand that I can see if the file is locked or checked-out by another user - that's good.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What exactly does the "&lt;EM&gt;ConsumableState&lt;/EM&gt;" tell me?&lt;/P&gt;&lt;P&gt;The SDK docs say: &lt;EM&gt;Gets or sets the state which describes if the entity on disk is the latest consumable entity.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why do I need to check that? Is the state on the disk important? Doesn't the "&lt;EM&gt;IExplorerUtil.UpdateFileProperties&lt;/EM&gt;"-method handle everything required around the property update (like check-out and check-in) by itself?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there something else I need to check before trying to update the file properties?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2025 09:26:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/get-file-permissions/m-p/13370696#M166</guid>
      <dc:creator>ppauleSHGR6</dc:creator>
      <dc:date>2025-03-14T09:26:21Z</dc:date>
    </item>
    <item>
      <title>Re: Get file permissions</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/get-file-permissions/m-p/13374905#M167</link>
      <description>&lt;P&gt;The ExplorerUtil.UpdateFileProperties method executes all required steps, including check-out/-in. However, you asked how to identify more details for reasons if it fails. The consumable state is the most precise information that the current user can check out and edit a file; it even differentiates a check-out to the current user on a different machine. As mentioned earlier, the entity status info evaluates the result of the current access control without the need to read all the lifecycle or object-based security.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Mar 2025 10:28:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/get-file-permissions/m-p/13374905#M167</guid>
      <dc:creator>Markus.Koechl</dc:creator>
      <dc:date>2025-03-17T10:28:50Z</dc:date>
    </item>
    <item>
      <title>Re: Get file permissions</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/get-file-permissions/m-p/13375180#M168</link>
      <description>&lt;P&gt;Hi Markus and thanks for your reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tested your mentioned code and either I still don't quite understand the purpose of the consumable state for my goal or I do it wrong.&lt;/P&gt;&lt;P&gt;Now I wrote a method that checks for the following things before the file is updated via the "&lt;EM&gt;ExplorerUtil.UpdateFileProperties&lt;/EM&gt;" method:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Is the file checked out by another user (yes, I saw I could also do this with the help of the &lt;EM&gt;EntityStatus&lt;/EM&gt;&amp;nbsp;class, but I anyways want to get the username for a more detailed output message)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;if (file.CheckedOut)
{
	if (file.CkOutUserId != m_serviceManager.AuthService.Session.User.Id)
	{
		User ckOutUser = m_serviceManager.AdminService.GetUserByUserId(file.CkOutUserId);
		errorMessage = $"File is checked out to another user -&amp;gt; {ckOutUser.Name}";
		return false; // file cannot be edited
	}
}​&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Is the file in obsolete or released state&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;LfCycState fileState = m_serviceManager.LifeCycleService.GetLifeCycleStatesByIds(new long[] { file.FileLfCyc.LfCycStateId }).FirstOrDefault();
if (fileState.ObsoleteState || fileState.ReleasedState)
{
    errorMessage = $"File is in non editable state -&amp;gt; {fileState.DispName}";
    return false; // file cannot be edited
}​&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Is the file locked (this is probably already covered by checking the lifecycle state for "obsolete" and "released"?)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;PropertyDefinitionDictionary propDefs = connection.PropertyManager.GetPropertyDefinitions(EntityClassIds.Files, null, PropertyDefinitionFilter.IncludeAll);
PropertyDefinition mVaultStatus = propDefs[PropertyDefinitionIds.Client.VaultStatus];
FileIteration mFileIt = new FileIteration(connection, file);
EntityStatusImageInfo mStatus = connection.PropertyManager.GetPropertyValue(mFileIt, mVaultStatus, null) as EntityStatusImageInfo;

if (mStatus.Status.LockState == EntityStatus.LockStateEnum.Locked)
{
    errorMessage = "File is in locked state";
    return false; // file cannot be edited
}​&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Is the file in the consumable state "EntityStatus.ConsumableStateEnum.LatestConsumable"&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;if (mStatus.Status.ConsumableState != EntityStatus.ConsumableStateEnum.LatestConsumable)
{
    errorMessage = "File is not in consumable state";
    return false; // file cannot be edited ???
}​&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Following CAD documents that are checked-in don't return the consumable state "EntityStatus.ConsumableStateEnum.LatestConsumable" but I expect that these documents would have been updated without problems via the "&lt;EM&gt;ExplorerUtil.UpdateFileProperties&lt;/EM&gt;" method:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ppauleSHGR6_0-1742215267813.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1478683i10A5B0778F6CAEBE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ppauleSHGR6_0-1742215267813.png" alt="ppauleSHGR6_0-1742215267813.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ppauleSHGR6_1-1742215379293.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1478684iC881F61A44123AC2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ppauleSHGR6_1-1742215379293.png" alt="ppauleSHGR6_1-1742215379293.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Documents that are released and locked also return the&amp;nbsp;consumable state "EntityStatus.ConsumableStateEnum.Unkown", that's why I check specifically for the lifecycle state and lock state.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far I don't see the benefit of checking the consumable state or I'm misunderstanding you in general.&lt;/P&gt;&lt;P&gt;What do I understand wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your assistance!&lt;/P&gt;</description>
      <pubDate>Mon, 17 Mar 2025 13:08:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/get-file-permissions/m-p/13375180#M168</guid>
      <dc:creator>ppauleSHGR6</dc:creator>
      <dc:date>2025-03-17T13:08:48Z</dc:date>
    </item>
    <item>
      <title>Re: Get file permissions</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/get-file-permissions/m-p/13375653#M169</link>
      <description>&lt;P&gt;I am sorry for leading you in the wrong direction with the consumable state; this is irrelevant as you are not downloading a file for edits rather than updating metadata only. Anyway, I would recommend using this cascade:&lt;/P&gt;
&lt;P&gt;- Check that the file is not cloaked (means it is read accessible as a minimum, and to avoid subsequent calls to fail)&lt;/P&gt;
&lt;P&gt;- Check that the file is not locked by leveraging the EntityStatusImageInfo Lockstate. (it will return a reliable result of any life cycle state, not only for states having the Obsolete/Released flag)&lt;/P&gt;
&lt;P&gt;- check that the file is available for check-out. An unlocked file that another user has not checked out should be available.&lt;BR /&gt;I hope having clarified now. I appreciate your patience.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Mar 2025 17:06:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/get-file-permissions/m-p/13375653#M169</guid>
      <dc:creator>Markus.Koechl</dc:creator>
      <dc:date>2025-03-17T17:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: Get file permissions</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/get-file-permissions/m-p/13376601#M170</link>
      <description>&lt;P&gt;Then I understood everything now and I achieved everything I needed.&lt;BR /&gt;Thank you for your clarification, your assistance is very much appreciated. &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Mar 2025 07:54:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/get-file-permissions/m-p/13376601#M170</guid>
      <dc:creator>ppauleSHGR6</dc:creator>
      <dc:date>2025-03-18T07:54:22Z</dc:date>
    </item>
  </channel>
</rss>

