?
Solved

Need help with edit rights, get an error

Posted on 2003-11-29
18
Medium Priority
?
603 Views
Last Modified: 2013-12-18
Hi guys

I seem to be having edit rights problems

I have two forms

When the first form status is Approved or Cancelled a script runs which updates the second form.

There is an error message
You cannot update or delete the document since you are not listed as an allowable Author for this document


The Edit_Rights field on the second form is Authors, Computed, Allow Multiple Values

Formula is @Trim("[Admin]":cur_Manager:cur_SiteManager)

When I look at the Edit_rights field thru the properties box the sorrect names are showing.



0
Comment
Question by:adspmo
  • 8
  • 4
  • 3
  • +1
18 Comments
 

Author Comment

by:adspmo
ID: 9843055
The edit rights field has the same properties as the second form

One := @If(ApprovalStatus = "Draft" ; RequesterName ;"");
Two :=@If(Status_Flag = "2"& ApprovalStatus ="Processing";Approver_1 ; "");
Three :=@If(Status_Flag = "3"& ApprovalStatus ="Processing";Approver_2 ;"");
No := "NoAccess";
Rejected := @If(Status_Flag = "1" & ApprovalStatus = "Rejected"; RequesterName;"");
Rights := @Unique (@Trim ( "[Coordinator]" : One:Two:Three:Rejected:No));
@Trim(Rights)

I am wondering if this could be because the formula that sets the ApprovalStatus sets the status to Approved and the Staus Flag field is set to "4"
Maybe I should set this is the Approval Script after the other forms have been updated

What do you think

James
0
 
LVL 13

Expert Comment

by:CRAK
ID: 9843080
Depending on notes/web client and user triggered/scheduled, it could be the user that updates those doc's or the signer of the agent. Find out who is actually updating those doc's by printing the username, or by showing it in a @prompt([OK]; ..)-box or messagebox.

Another cause could be the the format in which cur_Manager and cur_SiteManager store usernames. Don't use common names, but include all OU's etc.
0
 
LVL 13

Expert Comment

by:CRAK
ID: 9843117
Your 2nd post wasn't there just a few minutes ago. Still, it could depend on the format of RequesterName, Approver_1 and Approver_2.

Your concern about Status_Flag="4" etc., could be valid if you manage to write the new authors value to the documents: it would only leave "[Coordinator]" if you set the authors field to Rights.
The current problem is caused by what's already stored in the author field; not in its inteded new value!

Confusing... you've now given two different author formulas for the 2nd form....!
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:adspmo
ID: 9843208
THe 2nd formula is the edit rights for the first form

James
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9844028
Hi adspmo,

Please copy the full text of the properties box (click and drag from "Field name" and drag past the bottom until Notes will not scroll any further; make sure to get the last few chacareters; then press CONTROL-C to copy).

Please also post the update script.

Best regards,
qwaletee
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 9844265
It is your first form I believe which is raising the error. As a quick test include Username at the end of the formula

like

@Trim(Rights : @UserName), this should bypass that error.

In that case include another display author field which will include the @UserName as the author until the current doc is saved and afterwards the user loses rights..if that was your original intention.

~Hemanth
0
 

Author Comment

by:adspmo
ID: 9846145
Hi

I tried the UserName Thing and It worked, However it holds the UserName and won't refresh when the new user opens the doc

Also should this pick up the Username when in read or does it have to be in edit to pick up the new mame. Either way it is not

The new field is called

CurrentAuthor  Author Computed for Display

James
0
 
LVL 13

Expert Comment

by:CRAK
ID: 9846176
You'll need to edit it in order to change it. Is there a way to gain access through those userroles temporarily, to set things right?
0
 

Author Comment

by:adspmo
ID: 9846211
It fails with the UserROles, CurrentAuthor etc..


It fails in the Savit
SaveIT:
      doc.ComputeWithForm True, False  
      doc.save True, False  Here is where it fails

I am beginning to think it is the 2nd form that is causing the grief

It has as edit_rightd field as well

Here is the properties from the first form
Field Name: Edit_Rights
Data Type: Text List
Data Length: 66 bytes
Seq Num: 2
Dup Item ID: 0
Field Flags: SUMMARY READ/WRITE-ACCESS NAMES

"[Coordinator]"
"Approver Two"
"NoAccess"
"CN=James Wood/O=TestPMO"

Second form

Field Name: edit_rights
Data Type: Text List
Data Length: 39 bytes
Seq Num: 2
Dup Item ID: 0
Field Flags: SUMMARY READ/WRITE-ACCESS NAMES

"[Admin]"
"Site Manager"
"Approver Two"


I am using the Approver Two id

Will the first form pick the field CurrentAuthor if it is set to  Computed for Display and what would be the best way to set it to Null when the current user exits the document??

James
0
 

Author Comment

by:adspmo
ID: 9846248
I forgot I am at home so this is a local copy Userroles won't work

Have to wait till tomorrow to test that

Still I want to verify my edit right setup

I would be interested in any other way of acheiving succes with this as well
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 9846673
First the local copy can be enforced for acl restrictions by enabling enforce consistent acl across all replicas inthe advanced section of acl dialog settings.

If you are successful with Username.. then why should the new user opening the doc should lose access.. anyone other has role like "[Coordinator]" or "Approver Two" or "NoAccess"  (I believe last two are groups) can always access the document. Can you explain how this access restrictions should work in detail ?
0
 

Author Comment

by:adspmo
ID: 9847679
One := @If(ApprovalStatus = "Draft" ; NameFull;""); Pretty Obvious

Two :=@If(Status_Flag = "2"& ApprovalStatus ="Processing";Approver_1 ; "");Should only be Approver_1(fieldname)

Three :=@If(Status_Flag = "3"& ApprovalStatus ="Processing";Approver_2 ;"");Should only be Approver_2(fieldname)


No := "NoAccess";Is nobody,a fake name,Keeps people out

Rejected := @If(Status_Flag = "1" & ApprovalStatus = "Rejected"; RequesterName;"");Obvious

Rights := @Unique (@Trim ( "[Coordinator]" : One:Two:Three:Rejected:No));

So it One when...Two When.... Etc...

@Trim(Rights)I did add user name but what happened was I create with one id ,and submit to to be approved, when the person listed in the Approver_2 field approves,get Notes Error

You cannot update or delete the document since you are not listed as an allowable Author for this document

This happens on the

doc.save True, False


James
0
 

Author Comment

by:adspmo
ID: 9847684
Here is the script that runs. There is a formula as well in the Approved button if you need to see it let me knnow

Sub Approved
      'Set the session and db variables
      Dim ws As New NotesUIWorkspace
      Dim session As New NotesSession
      Dim db As NotesDatabase
      Dim doc As NotesDocument, note As notesdocument
      Dim view As NotesView
      Set note = ws.CurrentDocument.Document
      Set db = session.CurrentDatabase
      Set view = db.GetView( "AvailHol")
      If view Is Nothing Then
            Msgbox "Cannot find view"
            Exit Sub
      End If
      If note.HasItem("NameFull") Then
            Set doc = view.GetDocumentByKey(note.RequesterName(0)) ' KEY Value passed to view
      Else
            Msgbox "No leave document found for this employee"
      End If
      
      If Not doc Is Nothing Then
      'The conditions for processing the vacation vary greatly thus the variety of variables
      'There is a field named carry over and it may contain Carried over vacation days. These need to be used first
      'then the alloted vacation. If the Carry Over are not used by July then they are forfeited
            
            If note.type(0) = "Vacation" And  Month(note.StartDate(0)) >6 Then '
                  tmpNewDaysTotal = note.NewDaysTotal(0)    'Number of actual vacation days
                  tmpAllowanceAH_1 = tmpNewDaysTotal + doc.AllowanceAH_1(0) 'calculate the number of used vacation days
                  tmpAllowanceAH_2 = doc.allowanceAH_2(0) - tmpNewDaysTotal ' calculate the remaining vacation days
                  doc.AllowanceAH_1 = tmpAllowanceAH_1
                  doc.AllowanceAH_2 = tmpAllowanceAH_2
                  doc.totalAH_1 = doc.CarriedOverAH_1(0) + doc.AllowanceAH_1(0) 'Calculate the used vacation  days
                  doc.totalAH_2 = doc.CarriedOverAH_2(0) + doc.AllowanceAH_2(0)'Calculate the remaining vacation days
                  Goto SaveIt
                  
            Else
                  If Month(note.StartDate(0)) < 6 And note.type(0) = "Vacation" Then
                        If note.newdaystotal(0)  =< doc.CarriedOverAH_2(0) Then 'Check the carryover remaing days first
                              doc.CarriedOverAH_1 = doc.CarriedOverAH_1(0) + note.NewDaysTotal(0) 'Calculate the used carryover  days
                              doc.CarriedOverAH_2 = doc.CarriedOverAH(0) - note.NewDaysTotal(0) 'Calculate the remaining carryover days  days
                              doc.totalAH_1 = doc.CarriedOverAH_1(0) + doc.AllowanceAH_1(0)'Calculate the used vacation  days
                              doc.totalAH_2 = doc.CarriedOverAH_2(0) + doc.AllowanceAH_2(0)'Calculate the remaining vacation days
                              Goto SaveIt
                              
                        Else
                              If (doc.CarriedOverAH_2(0) <> 0)  And (note.newdaystotal(0)  > doc.CarriedOverAH_2(0)) Then
                                    tmpCarriedOverAH_2 = doc.CarriedOverAH_2(0) 'Get the current value
                                    tmpNewDay = note.newdaystotal(0) - tmpCarriedOverAH_2  'Calculate the difference between the requested and the carryover
                                    tmpAllowanceAH_2 = doc.AllowanceAH_2(0) - tmpNewDay ' calculate the remaining vacation days
                                    tmpAllowanceAH_1 = doc.AllowanceAH_1(0) + tmpNewDay  'calculate the number of used vacation days
                                    doc.CarriedOverAH_1 = doc.CarriedOverAH_1(0) + tmpCarriedOverAH_2 'Calculate the used carryover  days
                                    doc.CarriedOverAH_2 = 0 'Set the available to 0
                                    doc.AllowanceAH_1 = tmpAllowanceAH_1 'Set the values
                                    doc.AllowanceAH_2 = tmpAllowanceAH_2 'Set the values
                                    doc.totalAH_1 = doc.CarriedOverAH_1(0) + doc.AllowanceAH_1(0) 'Calculate the used vacation  days
                                    doc.totalAH_2 = doc.CarriedOverAH_2(0) + doc.AllowanceAH_2(0) 'Calculate the remaining vacation days
                                    Goto SaveIt
                              Else
                                    If doc.CarriedOverAH_2(0) = 0 Then
                                          tmpNewDaysTotal = note.NewDaysTotal(0)    'Requested days vacation
                                          tmpAllowanceAH_1 = tmpNewDaysTotal + doc.AllowanceAH_1(0) 'calculate the number of used vacation days
                                          tmpAllowanceAH_2 = doc.allowanceAH_2(0) - tmpNewDaysTotal ' calculate the remaining vacation days
                                          doc.AllowanceAH_1 = tmpAllowanceAH_1  'Set the values
                                          doc.AllowanceAH_2 = tmpAllowanceAH_2   'Set the values
                                          doc.totalAH_1 = doc.CarriedOverAH_1(0) + doc.AllowanceAH_1(0)  'Calculate the used vacation  days
                                          doc.totalAH_2 = doc.CarriedOverAH_2(0) + doc.AllowanceAH_2(0)   'Calculate the remaining vacation days
                                          Goto SaveIt
                                    End If
                              End If
                        End If
                  End If
            End If
            
            If note.type(0) = "Personal" Then
                  tmpPersonalDaysAH_2 =doc.PersonalDaysAH_2(0) - note.NewDaysTotal(0) 'Calculate the remaining personaldays
                  tmpPersonalDaysAH_1 = note.NewDaysTotal(0) + doc.PersonalDaysAH_1(0)'Calculate the used days
                  doc.PersonalDaysAH_2 = tmpPersonalDaysAH_2  'Set the values
                  doc.PersonalDaysAH_1 = tmpPersonalDaysAH_1   'Set the values
                  Goto SaveIt
                  
                  
                  If note.type(0) = "Work From Home" Then
                  End If
                  
SaveIT:
                  doc.ComputeWithForm True, False  
                  doc.save True, False
            End If      
      End If
End Sub
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9856509
I assume Approver Two is an actual Notes ID, and has a hierarchical name, e.g., CN=Approver Two/O=TestPMO, correct? You shoudl have the full canonical, hierarchical name listed, not just the common name part of the ID.
0
 

Author Comment

by:adspmo
ID: 9866466
So should I use just @username then
0
 
LVL 24

Assisted Solution

by:HemanthaKumar
HemanthaKumar earned 1000 total points
ID: 9866999
yes that should do
0
 
LVL 31

Accepted Solution

by:
qwaletee earned 1000 total points
ID: 9871867
adspmo,
> So should I use just @username then
In author field calculations?  Yes.  Not @Name(...; @UserName), just plain @UserName.
0
 
LVL 13

Expert Comment

by:CRAK
ID: 9874487
'Told ya so.... don't use common names!
;-)
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question