This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

UNSAccountBInUNSGroupB Update - Write permission denied for value "Group".

When trying to update record in UNSAccountBInUNSGroupB I'm getting error:

[810222] Error executing script 'VRS_UNSAccountBInUNSGroupB_Update'.
    at VI.ObjectBrowser.Parts.ScriptDebuggerControl.mnuRun_Activate(Object sender, EventArgs e)
    at VI.DB.Scripting.ScriptRunner.Eval(String key, Object[] parameters)
[810025] User accounts: assignments to system entitlements: Write permission denied for value "Group".
    at VI.DB.Entities.PermissionsEntityColumnBase.<SetValueAsync>d__17.MoveNext()
    at VI.DB.Entities.PermissionsEntityColumnBase._CheckCanEdit()

I'm using script:

Public Function VRS_UNSAccountBInUNSGroupB_Update(ByVal UID_UNSAccountB As String, ByVal UID_UNSGroupB As String) As Boolean

    Dim UNSAccountBInUNSGroupB As IEntity = Nothing
    Dim f As ISqlFormatter = Connection.SqlFormatter
	Dim result As String = ""
	
	If Session.Source.TryGet( Query.From("UNSAccountBInUNSGroupB") _
							  .Where(f.Comparison("UID_UNSAccountB", UID_UNSAccountB, ValType.String, CompareOperator.Equal, FormatterOptions.NonUnicodeLiterals)) _
							  .SelectNonLobs, UNSAccountBInUNSGroupB )
	    UNSAccountBInUNSGroupB.PutValue("UID_UNSGroupB", UID_UNSGroupB)
	End If
	
	Using uow As IUnitOfWork = Session.StartUnitOfWork()
        uow.Put(UNSAccountBInUNSGroupB)
        uow.Commit()
    End Using

    Return True

End Function

 

PS. There is no account definition assigned to UNSAccountB

  • The error message is saying, that you do not have the permissions to write the group property, which is the caption for your column UID_UNSGroupB you are trying to change.

    Reason for that is, that you cannot update any of the primary key values in your assignment table UNSAccountBInUNSGroupB.

    From the code I assume, that you want to change an existing group membership for an user. If so, you need the delete the old membership and create a new one.