Re: [Trac] Custom policies

2017-05-10 Thread toto200891
It worked now, I just copied the latest revision for plugin and recompiled 
it again, and now it works! Thanks a lot.

Regards,

SF

On Wednesday, May 10, 2017 at 10:37:46 AM UTC+2, RjOllos wrote:
>
>
>
> On Wed, May 10, 2017 at 1:34 AM toto200891  > wrote:
>
>> By doing so It may affect the search filters
>>
>
> It will not. I fixed that issue in the latest revision of the plugin.
>
> Please consider replying below the text you intend to respond to, as it 
> makes the conversation easier to follow.
>
> - Ryan 
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-10 Thread Ryan Ollos
On Wed, May 10, 2017 at 1:41 AM Ryan Ollos  wrote:

> On Wed, May 10, 2017 at 1:38 AM Ryan Ollos  wrote:
>
>> On Wed, May 10, 2017 at 1:36 AM toto200891 
>> wrote:
>>
>>> I tried revoking the permission TICKET VIEW, which in turn affected the
>>> permission TICKET VIEW REPORTED
>>>
>>
>> "Affected" how? Please explain the change in behavior.
>>
>> - Ryan
>>
>
> You are using the wrong plugin source. Several messages back I posted new
> code, but you aren't using it. Please copy and paste the following into
> your SupportDeskPolicy.py.
>

I've also put the latest revision of the permission policy source code on
the wiki:
https://trac.edgewall.org/wiki/CookBook/PermissionPolicies#SupportDeskPolicy

- Ryan

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-10 Thread Ryan Ollos
On Wed, May 10, 2017 at 1:38 AM Ryan Ollos  wrote:

> On Wed, May 10, 2017 at 1:36 AM toto200891 
> wrote:
>
>> I tried revoking the permission TICKET VIEW, which in turn affected the
>> permission TICKET VIEW REPORTED
>>
>
> "Affected" how? Please explain the change in behavior.
>
> - Ryan
>

You are using the wrong plugin source. Several messages back I posted new
code, but you aren't using it. Please copy and paste the following into
your SupportDeskPolicy.py.

Please use the following:

# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wiki/TracLicense.
#
# This software consists of voluntary contributions made by many
# individuals. For the exact contribution history, see the revision
# history and logs, available at http://trac.edgewall.org/log/.

from trac.core import *
from trac.perm import IPermissionPolicy, IPermissionRequestor
from trac.resource import ResourceNotFound
from trac.ticket.model import Ticket


class SupportDeskPolicy(Component):
"""Provides a permission for restricting ticket actions to the
ticket owner.
"""

implements(IPermissionPolicy, IPermissionRequestor)

# IPermissionRequestor methods

def get_permission_actions(self):
return ['TICKET_VIEW_REPORTED']

# IPermissionPolicy methods

def check_permission(self, action, username, resource, perm):
if username != 'anonymous' and \
action == 'TICKET_VIEW' and \
'TICKET_ADMIN' not in perm:
if 'TICKET_VIEW_REPORTED' in perm:
if resource is None or \
resource.realm == 'ticket' and \
resource.id is None:
return True
elif resource.realm == 'ticket' and \
resource.id is not None:
try:
ticket = Ticket(self.env, resource.id)
except ResourceNotFound:
pass
else:
return username in (ticket['reporter'],
ticket['owner'])

[ end of message ]

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-10 Thread Ryan Ollos
On Wed, May 10, 2017 at 1:36 AM toto200891 
wrote:

> I tried revoking the permission TICKET VIEW, which in turn affected the
> permission TICKET VIEW REPORTED
>

"Affected" how? Please explain the change in behavior.

- Ryan

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-10 Thread Ryan Ollos
On Wed, May 10, 2017 at 1:34 AM toto200891 
wrote:

> By doing so It may affect the search filters
>

It will not. I fixed that issue in the latest revision of the plugin.

Please consider replying below the text you intend to respond to, as it
makes the conversation easier to follow.

- Ryan

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-10 Thread toto200891
I tried revoking the permission TICKET VIEW, which in turn affected the 
permission TICKET VIEW REPORTED 

On Wednesday, May 10, 2017 at 10:34:05 AM UTC+2, toto200891 wrote:
>
> By doing so It may affect the search filters
>
> On Wednesday, May 10, 2017 at 10:29:29 AM UTC+2, RjOllos wrote:
>>
>> On Wed, May 10, 2017 at 1:25 AM Ryan Ollos  wrote:
>>
>>> On Wed, May 10, 2017 at 1:22 AM toto200891  
>>> wrote:
>>>
 Please find the attached screenshots.

 SF

>>>
>> Also, it will be safer to revoke "TICKET_VIEW" from "toto". For users 
>> that should only view tickets reported or owned, only grant them 
>> TICKET_VIEW_REPORTED.
>>
>> - Ryan
>>  
>>
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-10 Thread Ryan Ollos
On Wed, May 10, 2017 at 1:33 AM toto200891 
wrote:

> Yes test is the trac-admin in my project. And toto does not have the
> permission of TRAC ADMIN OR TICKET ADMIN and neither the anonymous nor the
> authenticated have the TRAC ADMIN OR TICKET ADMIN permissions. Here is the
> attched screenshot of the permission list
>
> Regards,
> SF
>

Did you restart the web server after updating the plugin code?

Let's revisit the debugging we did earlier. With the policy enabled, you
should get the following when visiting a ticket the user should not be
allowed to view (user is not reporter or owner of ticket):

01:20:15 Trac[main] DEBUG: Dispatching 
01:20:15 Trac[main] DEBUG: Chosen handler is 
01:20:15 Trac[session] DEBUG: Retrieving session for ID u'user3'
01:20:15 Trac[perm] DEBUG: No policy allowed user3 performing TICKET_ADMIN
on 
01:20:15 Trac[perm] DEBUG: SupportDeskPolicy denies user3 performing
TICKET_VIEW on 
[...]

and for a ticket the user is allowed to view,

01:21:58 Trac[main] DEBUG: Dispatching 
01:21:58 Trac[main] DEBUG: Chosen handler is 
01:21:58 Trac[session] DEBUG: Retrieving session for ID u'user3'
01:21:58 Trac[perm] DEBUG: No policy allowed user3 performing TICKET_ADMIN
on 
01:21:58 Trac[perm] DEBUG: No policy allowed user3 performing
TICKET_EDIT_CC on 
01:21:58 Trac[perm] DEBUG: No policy allowed user3 performing EMAIL_VIEW on
None
01:21:58 Trac[perm] DEBUG: No policy allowed user3 performing TICKET_ADMIN
on 

- Ryan

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-10 Thread toto200891
By doing so It may affect the search filters

On Wednesday, May 10, 2017 at 10:29:29 AM UTC+2, RjOllos wrote:
>
> On Wed, May 10, 2017 at 1:25 AM Ryan Ollos > 
> wrote:
>
>> On Wed, May 10, 2017 at 1:22 AM toto200891 > > wrote:
>>
>>> Please find the attached screenshots.
>>>
>>> SF
>>>
>>
> Also, it will be safer to revoke "TICKET_VIEW" from "toto". For users that 
> should only view tickets reported or owned, only grant them 
> TICKET_VIEW_REPORTED.
>
> - Ryan
>  
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-10 Thread toto200891
Yes test is the trac-admin in my project. And toto does not have the 
permission of TRAC ADMIN OR TICKET ADMIN and neither the anonymous nor the 
authenticated have the TRAC ADMIN OR TICKET ADMIN permissions. Here is the 
attched screenshot of the permission list

Regards,
SF
On Wednesday, May 10, 2017 at 10:25:58 AM UTC+2, RjOllos wrote:
>
>
>
> On Wed, May 10, 2017 at 1:22 AM toto200891  > wrote:
>
>> Please find the attached screenshots.
>>
>> SF
>>
>
> User "test" will certainly be able to view all tickets, because TRAC_ADMIN 
> grants the ability to effectively bypass all permissions.
>
> Since I may not be seeing all the permissions, can you confirm that "toto" 
> doesn't have TRAC_ADMIN or TICKET_ADMIN. Also, "anonymous" and 
> "authenticated" cannot have those permissions.
>
> If you can go to the command line, please run:
>
> $ trac-admin /path/to/env permission list toto
>
> - Ryan 
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-10 Thread Ryan Ollos
On Wed, May 10, 2017 at 1:25 AM Ryan Ollos  wrote:

> On Wed, May 10, 2017 at 1:22 AM toto200891 
> wrote:
>
>> Please find the attached screenshots.
>>
>> SF
>>
>
Also, it will be safer to revoke "TICKET_VIEW" from "toto". For users that
should only view tickets reported or owned, only grant them
TICKET_VIEW_REPORTED.

- Ryan

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-10 Thread Ryan Ollos
On Wed, May 10, 2017 at 1:22 AM toto200891 
wrote:

> Please find the attached screenshots.
>
> SF
>

User "test" will certainly be able to view all tickets, because TRAC_ADMIN
grants the ability to effectively bypass all permissions.

Since I may not be seeing all the permissions, can you confirm that "toto"
doesn't have TRAC_ADMIN or TICKET_ADMIN. Also, "anonymous" and
"authenticated" cannot have those permissions.

If you can go to the command line, please run:

$ trac-admin /path/to/env permission list toto

- Ryan

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-10 Thread toto200891
Please find the attached screenshots.

SF

On Wednesday, May 10, 2017 at 10:05:49 AM UTC+2, RjOllos wrote:
>
>
>
> On Wed, May 10, 2017 at 12:56 AM toto200891  > wrote:
>
>> Yes I have checked, everything is in proper place. But every user is 
>> still able to see all the tickets.
>>
>> SF
>>
>
> Please go to the /about page and take a screen capture of the portion of 
> the table that lists [trac] permission_policies.
>
> Please share a screen capture of your permissions page showing the 
> permissions you've granted to users.
>
> - Ryan 
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-10 Thread Ryan Ollos
On Wed, May 10, 2017 at 12:56 AM toto200891 
wrote:

> Yes I have checked, everything is in proper place. But every user is still
> able to see all the tickets.
>
> SF
>

Please go to the /about page and take a screen capture of the portion of
the table that lists [trac] permission_policies.

Please share a screen capture of your permissions page showing the
permissions you've granted to users.

- Ryan

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-10 Thread toto200891
Yes I have checked, everything is in proper place. But every user is still 
able to see all the tickets.

SF

On Wednesday, May 10, 2017 at 9:48:14 AM UTC+2, RjOllos wrote:
>
>
>
> On Wed, May 10, 2017 at 12:34 AM toto200891  > wrote:
>
>> Hi Ryan,
>>
>> With the above modifications, Now every user is able to view all tickets. 
>> It is revoking the actions of TICKET_VIEW_REPORTED permission
>>
>> Regards,
>>
>> SF
>>
>
> Please make sure your permission policy is as below. Users with 
> TICKET_VIEW_REPORTED will only be able to see tickets for which they are 
> the reporter or owner. Please make sure that SupportDeskPolicy is the first 
> in the list of permission_policies.
>
> # -*- coding: utf-8 -*-
> #
> # Copyright (C) 2017 Edgewall Software
> # All rights reserved.
> #
> # This software is licensed as described in the file COPYING, which
> # you should have received as part of this distribution. The terms
> # are also available at http://trac.edgewall.org/wiki/TracLicense.
> #
> # This software consists of voluntary contributions made by many
> # individuals. For the exact contribution history, see the revision
> # history and logs, available at http://trac.edgewall.org/log/.
>
> from trac.core import *
> from trac.perm import IPermissionPolicy, IPermissionRequestor
> from trac.resource import ResourceNotFound
> from trac.ticket.model import Ticket
>
>
> class SupportDeskPolicy(Component):
> """Provides a permission for restricting ticket actions to the
> ticket owner.
> """
>
> implements(IPermissionPolicy, IPermissionRequestor)
>
> # IPermissionRequestor methods
>
> def get_permission_actions(self):
> return ['TICKET_VIEW_REPORTED']
>
> # IPermissionPolicy methods
>
> def check_permission(self, action, username, resource, perm):
> if action == 'TICKET_VIEW' and \
> 'TICKET_ADMIN' not in perm:
> if 'TICKET_VIEW_REPORTED' in perm:
> if resource is None or \
> resource.realm == 'ticket' and \
> resource.id is None:
> return True
> elif resource.realm == 'ticket' and \
> resource.id is not None:
> try:
> ticket = Ticket(self.env, resource.id)
> except ResourceNotFound:
> pass
> else:
> return username in (ticket['reporter'], 
> ticket['owner'])
>
>
> [End of Message]
>
>  
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-10 Thread Ryan Ollos
On Wed, May 10, 2017 at 12:34 AM toto200891 
wrote:

> Hi Ryan,
>
> With the above modifications, Now every user is able to view all tickets.
> It is revoking the actions of TICKET_VIEW_REPORTED permission
>
> Regards,
>
> SF
>

Please make sure your permission policy is as below. Users with
TICKET_VIEW_REPORTED will only be able to see tickets for which they are
the reporter or owner. Please make sure that SupportDeskPolicy is the first
in the list of permission_policies.

# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wiki/TracLicense.
#
# This software consists of voluntary contributions made by many
# individuals. For the exact contribution history, see the revision
# history and logs, available at http://trac.edgewall.org/log/.

from trac.core import *
from trac.perm import IPermissionPolicy, IPermissionRequestor
from trac.resource import ResourceNotFound
from trac.ticket.model import Ticket


class SupportDeskPolicy(Component):
"""Provides a permission for restricting ticket actions to the
ticket owner.
"""

implements(IPermissionPolicy, IPermissionRequestor)

# IPermissionRequestor methods

def get_permission_actions(self):
return ['TICKET_VIEW_REPORTED']

# IPermissionPolicy methods

def check_permission(self, action, username, resource, perm):
if action == 'TICKET_VIEW' and \
'TICKET_ADMIN' not in perm:
if 'TICKET_VIEW_REPORTED' in perm:
if resource is None or \
resource.realm == 'ticket' and \
resource.id is None:
return True
elif resource.realm == 'ticket' and \
resource.id is not None:
try:
ticket = Ticket(self.env, resource.id)
except ResourceNotFound:
pass
else:
return username in (ticket['reporter'],
ticket['owner'])


[End of Message]

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-10 Thread toto200891
Hi Ryan,

With the above modifications, Now every user is able to view all tickets. 
It is revoking the actions of TICKET_VIEW_REPORTED permission

Regards,

SF

On Tuesday, May 9, 2017 at 7:25:46 PM UTC+2, RjOllos wrote:
>
>
>
> On Tuesday, May 9, 2017 at 9:54:40 AM UTC-7, RjOllos wrote:
>>
>>
>>
>> On Tuesday, May 9, 2017 at 8:12:29 AM UTC-7, toto200891 wrote:
>>>
>>> Hi,
>>>
>>> how could i give user a permission to view tickets assigned to him? Is 
>>> it possible?
>>>
>>> Regards,
>>>
>>> SF
>>>
>>
>> You can modify SupportDeskPolicy like so:
>>
>> - return ticket['reporter'] == username
>> + return username in (ticket['reporter'], ticket['owner'])
>>
>> That change will allow a user with TICKET_VIEW_REPORTER to only view 
>> ticket's for which they are the reporter or owner.
>>
>
> Sorry for my poor grammar! I should proof-read.
>
> More discussion about SupportDeskPolicy here:
> https://groups.google.com/forum/#!topic/trac-users/JGYZ81xuWjk
>
> - Ryan
>  
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-09 Thread toto200891
Thank you so much.

SF

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-09 Thread RjOllos


On Tuesday, May 9, 2017 at 9:54:40 AM UTC-7, RjOllos wrote:
>
>
>
> On Tuesday, May 9, 2017 at 8:12:29 AM UTC-7, toto200891 wrote:
>>
>> Hi,
>>
>> how could i give user a permission to view tickets assigned to him? Is it 
>> possible?
>>
>> Regards,
>>
>> SF
>>
>
> You can modify SupportDeskPolicy like so:
>
> - return ticket['reporter'] == username
> + return username in (ticket['reporter'], ticket['owner'])
>
> That change will allow a user with TICKET_VIEW_REPORTER to only view 
> ticket's for which they are the reporter or owner.
>

Sorry for my poor grammar! I should proof-read.

More discussion about SupportDeskPolicy here:
https://groups.google.com/forum/#!topic/trac-users/JGYZ81xuWjk

- Ryan
 

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-09 Thread RjOllos


On Tuesday, May 9, 2017 at 8:12:29 AM UTC-7, toto200891 wrote:
>
> Hi,
>
> how could i give user a permission to view tickets assigned to him? Is it 
> possible?
>
> Regards,
>
> SF
>

You can modify SupportDeskPolicy like so:

- return ticket['reporter'] == username
+ return username in (ticket['reporter'], ticket['owner'])

That change will allow a user with TICKET_VIEW_REPORTER to only view 
ticket's for which they are the reporter or owner.

- Ryan
 

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-09 Thread toto200891
I tried using ExtraPermissionProvider, but it doesnt seem to work.

SF

On Tuesday, May 9, 2017 at 5:12:29 PM UTC+2, toto200891 wrote:
>
> Hi,
>
> how could i give user a permission to view tickets assigned to him? Is it 
> possible?
>
> Regards,
>
> SF
>
> On Tuesday, May 9, 2017 at 11:35:44 AM UTC+2, toto200891 wrote:
>>
>> It worked as per my requirements.
>>
>> On Tuesday, May 9, 2017 at 11:35:20 AM UTC+2, toto200891 wrote:
>>>
>>> The first one with an else statement
>>>
>>> On Tuesday, May 9, 2017 at 11:32:53 AM UTC+2, RjOllos wrote:



 On Tuesday, May 9, 2017 at 2:24:56 AM UTC-7, toto200891 wrote:
>
> Perfect! It works. Thank you so much.
>

 Which variant did you end up using?

 - Ryan
  

>>>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-09 Thread toto200891
Hi,

how could i give user a permission to view tickets assigned to him? Is it 
possible?

Regards,

SF

On Tuesday, May 9, 2017 at 11:35:44 AM UTC+2, toto200891 wrote:
>
> It worked as per my requirements.
>
> On Tuesday, May 9, 2017 at 11:35:20 AM UTC+2, toto200891 wrote:
>>
>> The first one with an else statement
>>
>> On Tuesday, May 9, 2017 at 11:32:53 AM UTC+2, RjOllos wrote:
>>>
>>>
>>>
>>> On Tuesday, May 9, 2017 at 2:24:56 AM UTC-7, toto200891 wrote:

 Perfect! It works. Thank you so much.

>>>
>>> Which variant did you end up using?
>>>
>>> - Ryan
>>>  
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-09 Thread toto200891
The first one with an else statement

On Tuesday, May 9, 2017 at 11:32:53 AM UTC+2, RjOllos wrote:
>
>
>
> On Tuesday, May 9, 2017 at 2:24:56 AM UTC-7, toto200891 wrote:
>>
>> Perfect! It works. Thank you so much.
>>
>
> Which variant did you end up using?
>
> - Ryan
>  
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-09 Thread toto200891
It worked as per my requirements.

On Tuesday, May 9, 2017 at 11:35:20 AM UTC+2, toto200891 wrote:
>
> The first one with an else statement
>
> On Tuesday, May 9, 2017 at 11:32:53 AM UTC+2, RjOllos wrote:
>>
>>
>>
>> On Tuesday, May 9, 2017 at 2:24:56 AM UTC-7, toto200891 wrote:
>>>
>>> Perfect! It works. Thank you so much.
>>>
>>
>> Which variant did you end up using?
>>
>> - Ryan
>>  
>>
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-09 Thread RjOllos


On Tuesday, May 9, 2017 at 2:24:56 AM UTC-7, toto200891 wrote:
>
> Perfect! It works. Thank you so much.
>

Which variant did you end up using?

- Ryan
 

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-09 Thread toto200891
Perfect! It works. Thank you so much.

On Tuesday, May 9, 2017 at 10:56:22 AM UTC+2, RjOllos wrote:
>
>
>
> On Tuesday, May 9, 2017 at 1:52:08 AM UTC-7, RjOllos wrote:
>>
>>
>>
>> On Tuesday, May 9, 2017 at 1:24:55 AM UTC-7, toto200891 wrote:
>>>
>>> Thank you for the modification. But I see that, it is affecting the 
>>> search filters. With the permission ticket_view_reported, one cannot search 
>>> for his tickets. In other words, if the user have to search for a 
>>> particular ticket, he could not do it, as the ticket filter doesn't seem to 
>>> be enabled. 
>>>
>>> Regards,
>>>
>>> SF
>>>
>>
>> Yes, good point. Revoking TICKET_VIEW prevents the search filter from 
>> displaying. Instead, we could keep TICKET_VIEW for all users, and deny the 
>> action if the users doesn't possess TICKET_VIEW_REPORTED and the user isn't 
>> the ticket reporter. I've also considered that the most common case would 
>> be to allow users with TICKET_ADMIN to view all tickets. Please try the 
>> following:
>>
>>
>> # -*- coding: utf-8 -*-
>> #
>> # Copyright (C) 2017 Edgewall Software
>> # All rights reserved.
>> #
>> # This software is licensed as described in the file COPYING, which
>> # you should have received as part of this distribution. The terms
>> # are also available at http://trac.edgewall.org/wiki/TracLicense.
>> #
>> # This software consists of voluntary contributions made by many
>> # individuals. For the exact contribution history, see the revision
>> # history and logs, available at http://trac.edgewall.org/log/.
>>
>> from trac.core import *
>> from trac.perm import IPermissionPolicy, IPermissionRequestor
>> from trac.resource import ResourceNotFound
>> from trac.ticket.model import Ticket
>>
>>
>> class SupportDeskPolicy(Component):
>> """Provides a permission for restricting ticket actions to the
>> ticket owner.
>> """
>>
>> implements(IPermissionPolicy, IPermissionRequestor)
>>
>> # IPermissionRequestor methods
>>
>> def get_permission_actions(self):
>> return ['TICKET_VIEW_REPORTED']
>>
>> # IPermissionPolicy methods
>>
>> def check_permission(self, action, username, resource, perm):
>> if action == 'TICKET_VIEW' and \
>> resource is not None and \
>> resource.realm == 'ticket' and \
>> resource.id is not None and \
>> 'TICKET_ADMIN' not in perm:
>> if 'TICKET_VIEW_REPORTED' in perm:
>> try:
>> ticket = Ticket(self.env, resource.id)
>> except ResourceNotFound:
>> pass
>> else:
>> return ticket['reporter'] == username
>> else:
>> return False
>>
>>
>>
>> [End of Message]
>>
>
>
> To be more clear, please grant both TICKET_VIEW and TICKET_VIEW_REPORTED 
> to all users which you would like to see the ticket's they reported.
>
> I considered another variation. Perhaps you wish users with 
> TICKET_VIEW_REPORTED and TICKET_VIEW to see only the tickets they reported. 
> However, you may also with that a user with only TICKET_VIEW (and not 
> TICKET_VIEW_REPORTED) can see all tickets. In that case we can change the 
> policy to only grant/deny for users that have TICKET_VIEW_REPORTED by 
> removing the last else clause:
>
> # -*- coding: utf-8 -*-
> #
> # Copyright (C) 2017 Edgewall Software
> # All rights reserved.
> #
> # This software is licensed as described in the file COPYING, which
> # you should have received as part of this distribution. The terms
> # are also available at http://trac.edgewall.org/wiki/TracLicense.
> #
> # This software consists of voluntary contributions made by many
> # individuals. For the exact contribution history, see the revision
> # history and logs, available at http://trac.edgewall.org/log/.
>
> from trac.core import *
> from trac.perm import IPermissionPolicy, IPermissionRequestor
> from trac.resource import ResourceNotFound
> from trac.ticket.model import Ticket
>
>
> class SupportDeskPolicy(Component):
> """Provides a permission for restricting ticket actions to the
> ticket owner.
> """
>
> implements(IPermissionPolicy, IPermissionRequestor)
>
> # IPermissionRequestor methods
>
> def get_permission_actions(self):
> return ['TICKET_VIEW_REPORTED']
>
> # IPermissionPolicy methods
>
> def check_permission(self, action, username, resource, perm):
> if action == 'TICKET_VIEW' and \
> resource is not None and \
> resource.realm == 'ticket' and \
> resource.id is not None and \
> 'TICKET_ADMIN' not in perm:
> if 'TICKET_VIEW_REPORTED' in perm:
> try:
> ticket = Ticket(self.env, resource.id)
> except ResourceNotFound:
> pass
> else:
> return ticket['reporter'] == username
>
>
> - Ryan 
>

-- 

Re: [Trac] Custom policies

2017-05-09 Thread RjOllos


On Tuesday, May 9, 2017 at 1:52:08 AM UTC-7, RjOllos wrote:
>
>
>
> On Tuesday, May 9, 2017 at 1:24:55 AM UTC-7, toto200891 wrote:
>>
>> Thank you for the modification. But I see that, it is affecting the 
>> search filters. With the permission ticket_view_reported, one cannot search 
>> for his tickets. In other words, if the user have to search for a 
>> particular ticket, he could not do it, as the ticket filter doesn't seem to 
>> be enabled. 
>>
>> Regards,
>>
>> SF
>>
>
> Yes, good point. Revoking TICKET_VIEW prevents the search filter from 
> displaying. Instead, we could keep TICKET_VIEW for all users, and deny the 
> action if the users doesn't possess TICKET_VIEW_REPORTED and the user isn't 
> the ticket reporter. I've also considered that the most common case would 
> be to allow users with TICKET_ADMIN to view all tickets. Please try the 
> following:
>
>
> # -*- coding: utf-8 -*-
> #
> # Copyright (C) 2017 Edgewall Software
> # All rights reserved.
> #
> # This software is licensed as described in the file COPYING, which
> # you should have received as part of this distribution. The terms
> # are also available at http://trac.edgewall.org/wiki/TracLicense.
> #
> # This software consists of voluntary contributions made by many
> # individuals. For the exact contribution history, see the revision
> # history and logs, available at http://trac.edgewall.org/log/.
>
> from trac.core import *
> from trac.perm import IPermissionPolicy, IPermissionRequestor
> from trac.resource import ResourceNotFound
> from trac.ticket.model import Ticket
>
>
> class SupportDeskPolicy(Component):
> """Provides a permission for restricting ticket actions to the
> ticket owner.
> """
>
> implements(IPermissionPolicy, IPermissionRequestor)
>
> # IPermissionRequestor methods
>
> def get_permission_actions(self):
> return ['TICKET_VIEW_REPORTED']
>
> # IPermissionPolicy methods
>
> def check_permission(self, action, username, resource, perm):
> if action == 'TICKET_VIEW' and \
> resource is not None and \
> resource.realm == 'ticket' and \
> resource.id is not None and \
> 'TICKET_ADMIN' not in perm:
> if 'TICKET_VIEW_REPORTED' in perm:
> try:
> ticket = Ticket(self.env, resource.id)
> except ResourceNotFound:
> pass
> else:
> return ticket['reporter'] == username
> else:
> return False
>
>
>
> [End of Message]
>


To be more clear, please grant both TICKET_VIEW and TICKET_VIEW_REPORTED to 
all users which you would like to see the ticket's they reported.

I considered another variation. Perhaps you wish users with 
TICKET_VIEW_REPORTED and TICKET_VIEW to see only the tickets they reported. 
However, you may also with that a user with only TICKET_VIEW (and not 
TICKET_VIEW_REPORTED) can see all tickets. In that case we can change the 
policy to only grant/deny for users that have TICKET_VIEW_REPORTED by 
removing the last else clause:

# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wiki/TracLicense.
#
# This software consists of voluntary contributions made by many
# individuals. For the exact contribution history, see the revision
# history and logs, available at http://trac.edgewall.org/log/.

from trac.core import *
from trac.perm import IPermissionPolicy, IPermissionRequestor
from trac.resource import ResourceNotFound
from trac.ticket.model import Ticket


class SupportDeskPolicy(Component):
"""Provides a permission for restricting ticket actions to the
ticket owner.
"""

implements(IPermissionPolicy, IPermissionRequestor)

# IPermissionRequestor methods

def get_permission_actions(self):
return ['TICKET_VIEW_REPORTED']

# IPermissionPolicy methods

def check_permission(self, action, username, resource, perm):
if action == 'TICKET_VIEW' and \
resource is not None and \
resource.realm == 'ticket' and \
resource.id is not None and \
'TICKET_ADMIN' not in perm:
if 'TICKET_VIEW_REPORTED' in perm:
try:
ticket = Ticket(self.env, resource.id)
except ResourceNotFound:
pass
else:
return ticket['reporter'] == username


- Ryan 

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit t

Re: [Trac] Custom policies

2017-05-09 Thread RjOllos


On Tuesday, May 9, 2017 at 1:24:55 AM UTC-7, toto200891 wrote:
>
> Thank you for the modification. But I see that, it is affecting the search 
> filters. With the permission ticket_view_reported, one cannot search for 
> his tickets. In other words, if the user have to search for a particular 
> ticket, he could not do it, as the ticket filter doesn't seem to be 
> enabled. 
>
> Regards,
>
> SF
>

Yes, good point. Revoking TICKET_VIEW prevents the search filter from 
displaying. Instead, we could keep TICKET_VIEW for all users, and deny the 
action if the users doesn't possess TICKET_VIEW_REPORTED and the user isn't 
the ticket reporter. I've also considered that the most common case would 
be to allow users with TICKET_ADMIN to view all tickets. Please try the 
following:


# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wiki/TracLicense.
#
# This software consists of voluntary contributions made by many
# individuals. For the exact contribution history, see the revision
# history and logs, available at http://trac.edgewall.org/log/.

from trac.core import *
from trac.perm import IPermissionPolicy, IPermissionRequestor
from trac.resource import ResourceNotFound
from trac.ticket.model import Ticket


class SupportDeskPolicy(Component):
"""Provides a permission for restricting ticket actions to the
ticket owner.
"""

implements(IPermissionPolicy, IPermissionRequestor)

# IPermissionRequestor methods

def get_permission_actions(self):
return ['TICKET_VIEW_REPORTED']

# IPermissionPolicy methods

def check_permission(self, action, username, resource, perm):
if action == 'TICKET_VIEW' and \
resource is not None and \
resource.realm == 'ticket' and \
resource.id is not None and \
'TICKET_ADMIN' not in perm:
if 'TICKET_VIEW_REPORTED' in perm:
try:
ticket = Ticket(self.env, resource.id)
except ResourceNotFound:
pass
else:
return ticket['reporter'] == username
else:
return False



[End of Message]


-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-09 Thread toto200891
Thank you for the modification. But I see that, it is affecting the search 
filters. With the permission ticket_view_reported, one cannot search for 
his tickets. In other words, if the user have to search for a particular 
ticket, he could not do it, as the ticket filter doesn't seem to be 
enabled. 

Regards,

SF  

On Monday, May 8, 2017 at 1:32:35 AM UTC+2, RjOllos wrote:
>
>  
>
>
> On Thursday, May 4, 2017 at 6:28:31 AM UTC-7, toto200891 wrote:
>>
>> Oh great! That works!! Thank you so much.
>>
>> Thank you,
>>
>> SF
>>
>
> I noticed an issue with the permission policy. If you have a TracLink to a 
> non-existent ticket in the timeline, the timeline won't be viewable. I've 
> updated the code:
>
> https://trac.edgewall.org/wiki/CookBook/PermissionPolicies?version=14#SupportDeskPolicy
>
> - Ryan 
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-07 Thread RjOllos

>
>  


On Thursday, May 4, 2017 at 6:28:31 AM UTC-7, toto200891 wrote:
>
> Oh great! That works!! Thank you so much.
>
> Thank you,
>
> SF
>

I noticed an issue with the permission policy. If you have a TracLink to a 
non-existent ticket in the timeline, the timeline won't be viewable. I've 
updated the code:
https://trac.edgewall.org/wiki/CookBook/PermissionPolicies?version=14#SupportDeskPolicy

- Ryan 

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-04 Thread RjOllos


On Thursday, May 4, 2017 at 6:28:31 AM UTC-7, toto200891 wrote:
>
> Oh great! That works!! Thank you so much.
>
> Thank you,
>
> SF
>

If I had thought more clearly early on, I would have suggested to check the 
/about page and inspect the values in the table there, rather than asking 
for the configuration values directly from trac.ini. The duplicate entries 
for permission_policies would have been very apparent after inspecting the 
/about page - you would not have seen SupportDeskPolicy when inspecting the 
value.

- Ryan

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-04 Thread toto200891
Oh great! That works!! Thank you so much.

Thank you,

SF

On Thursday, May 4, 2017 at 2:54:14 PM UTC+2, RjOllos wrote:
>
>
>
> On Thu, May 4, 2017 at 5:48 AM toto200891  > wrote:
>
>> There are no denies, I have attached the log file, could you please have 
>> a look?
>>
>
> I overlooked what you had done wrong, even though it was clear in your 
> previous message.
>
> Set your permission_policies like this:
>
> permission_policies = SupportDeskPolicy,ReadonlyWikiPolicy,
> DefaultPermissionPolicy,LegacyAttachmentPolicy 
>
> You cannot define multiple entries with the same option name like you had 
> done. The latter will just overwrite the former and therefore 
> SupportDeskPolicy has not been active in your installation.
>
> - Ryan
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-04 Thread Ryan Ollos
On Thu, May 4, 2017 at 5:48 AM toto200891 
wrote:

> There are no denies, I have attached the log file, could you please have a
> look?
>

I overlooked what you had done wrong, even though it was clear in your
previous message.

Set your permission_policies like this:

permission_policies = SupportDeskPolicy,ReadonlyWikiPolicy,
DefaultPermissionPolicy,LegacyAttachmentPolicy

You cannot define multiple entries with the same option name like you had
done. The latter will just overwrite the former and therefore
SupportDeskPolicy has not been active in your installation.

- Ryan

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-04 Thread toto200891
There are no denies, I have attached the log file, could you please have a 
look?

Thank you
SF

On Thursday, May 4, 2017 at 2:37:40 PM UTC+2, RjOllos wrote:
>
>
>
> On Thursday, May 4, 2017 at 5:30:46 AM UTC-7, toto200891 wrote:
>>
>> When I create a ticket, it is displaying a message like ticket is been 
>> created, but you dont have permission to view it
>>
>
> Well, the only advice I have is to look for "SupportDeskPolicy denies ..." 
> in the log. That should give an indicated whether SupportDeskPolicy is 
> active but denying permission to view the ticket.
>
> - Ryan
>  
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.
2017-05-04 14:41:22,790 Trac[env] INFO:  
environment startup [Trac 1.2.1] 
2017-05-04 14:41:22,854 Trac[loader] DEBUG: Loading plugin "trac.about" from 
"c:\python27\lib\site-packages\trac-1.2.1-py2.7-win32.egg"
2017-05-04 14:41:22,854 Trac[loader] DEBUG: Loading plugin "trac.admin.console" 
from "c:\python27\lib\site-packages\trac-1.2.1-py2.7-win32.egg"
2017-05-04 14:41:22,901 Trac[loader] DEBUG: Loading plugin "trac.admin.web_ui" 
from "c:\python27\lib\site-packages\trac-1.2.1-py2.7-win32.egg"
2017-05-04 14:41:22,915 Trac[loader] DEBUG: Loading plugin "trac.attachment" 
from "c:\python27\lib\site-packages\trac-1.2.1-py2.7-win32.egg"
2017-05-04 14:41:22,915 Trac[loader] DEBUG: Loading plugin "trac.db.mysql" from 
"c:\python27\lib\site-packages\trac-1.2.1-py2.7-win32.egg"
2017-05-04 14:41:22,931 Trac[loader] DEBUG: Skipping "trac.db.mysql = 
trac.db.mysql_backend [mysql]": DistributionNotFound: The 'MySQL-python>=1.2.2' 
distribution was not found and is required by the application
2017-05-04 14:41:22,931 Trac[loader] DEBUG: Loading plugin "trac.db.postgres" 
from "c:\python27\lib\site-packages\trac-1.2.1-py2.7-win32.egg"
2017-05-04 14:41:22,963 Trac[loader] DEBUG: Skipping "trac.db.postgres = 
trac.db.postgres_backend [postgresql]": DistributionNotFound: The 
'psycopg2>=2.0' distribution was not found and is required by the application
2017-05-04 14:41:22,963 Trac[loader] DEBUG: Loading plugin "trac.db.sqlite" 
from "c:\python27\lib\site-packages\trac-1.2.1-py2.7-win32.egg"
2017-05-04 14:41:22,979 Trac[loader] DEBUG: Loading plugin 
"trac.mimeview.patch" from 
"c:\python27\lib\site-packages\trac-1.2.1-py2.7-win32.egg"
2017-05-04 14:41:22,979 Trac[loader] DEBUG: Loading plugin 
"trac.mimeview.pygments" from 
"c:\python27\lib\site-packages\trac-1.2.1-py2.7-win32.egg"
2017-05-04 14:41:23,009 Trac[loader] DEBUG: Skipping "trac.mimeview.pygments = 
trac.mimeview.pygments [pygments]": DistributionNotFound: The 'Pygments>=0.6' 
distribution was not found and is required by the application
2017-05-04 14:41:23,009 Trac[loader] DEBUG: Loading plugin "trac.mimeview.rst" 
from "c:\python27\lib\site-packages\trac-1.2.1-py2.7-win32.egg"
2017-05-04 14:41:23,025 Trac[loader] DEBUG: Skipping "trac.mimeview.rst = 
trac.mimeview.rst [rest]": DistributionNotFound: The 'docutils>=0.3.9' 
distribution was not found and is required by the application
2017-05-04 14:41:23,025 Trac[loader] DEBUG: Loading plugin "trac.mimeview.txtl" 
from "c:\python27\lib\site-packages\trac-1.2.1-py2.7-win32.egg"
2017-05-04 14:41:23,056 Trac[loader] DEBUG: Skipping "trac.mimeview.txtl = 
trac.mimeview.txtl [textile]": DistributionNotFound: The 'textile>=2.0' 
distribution was not found and is required by the application
2017-05-04 14:41:23,056 Trac[loader] DEBUG: Loading plugin 
"trac.notification.api" from 
"c:\python27\lib\site-packages\trac-1.2.1-py2.7-win32.egg"
2017-05-04 14:41:23,056 Trac[loader] DEBUG: Loading plugin 
"trac.notification.compat" from 
"c:\python27\lib\site-packages\trac-1.2.1-py2.7-win32.egg"
2017-05-04 14:41:23,056 Trac[loader] DEBUG: Loading plugin 
"trac.notification.mail" from 
"c:\python27\lib\site-packages\trac-1.2.1-py2.7-win32.egg"
2017-05-04 14:41:23,056 Trac[loader] DEBUG: Loading plugin 
"trac.notification.prefs" from 
"c:\python27\lib\site-packages\trac-1.2.1-py2.7-win32.egg"
2017-05-04 14:41:23,056 Trac[loader] DEBUG: Loading plugin "trac.prefs" from 
"c:\python27\lib\site-packages\trac-1.2.1-py2.7-win32.egg"
2017-05-04 14:41:23,056 Trac[loader] DEBUG: Loading plugin "trac.search" from 
"c:\python27\lib\site-packages\trac-1.2.1-py2.7-win32.egg"
2017-05-04 14:41:23,056 Trac[loader] DEBUG: Loading plugin "trac.ticket.admin" 
from "c:\python27\lib\site-packages\trac-1.2.1-py2.7-win32.egg"
2017-05-04 14:41:23,072 Trac[loader] DEBUG: Loading plugin "trac.ticket.batch" 
from "c:\python27\lib\site-packages\trac-1.2.1-py2.7-win32.egg"
2017-05-04 14:41:23,072 Trac[loader] DEBU

Re: [Trac] Custom policies

2017-05-04 Thread RjOllos


On Thursday, May 4, 2017 at 5:30:46 AM UTC-7, toto200891 wrote:
>
> When I create a ticket, it is displaying a message like ticket is been 
> created, but you dont have permission to view it
>

Well, the only advice I have is to look for "SupportDeskPolicy denies ..." 
in the log. That should give an indicated whether SupportDeskPolicy is 
active but denying permission to view the ticket.

- Ryan
 

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-04 Thread toto200891
When I create a ticket, it is displaying a message like ticket is been 
created, but you dont have permission to view it

SF

On Thursday, May 4, 2017 at 2:29:38 PM UTC+2, toto200891 wrote:
>
> Yes he is the authenticated user
>
> On Thursday, May 4, 2017 at 2:18:05 PM UTC+2, RjOllos wrote:
>>
>>
>>
>> On Thursday, May 4, 2017 at 5:06:53 AM UTC-7, toto200891 wrote:
>>>
>>> Yes I added, but user still cant view the ticket he created
>>>
>>
>> To be sure, the plugin won't work for anonymous users. The users must be 
>> authenticated. Is the user you have tested with authenticated?
>>
>> - Ryan 
>>
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-04 Thread toto200891
Yes he is the authenticated user

On Thursday, May 4, 2017 at 2:18:05 PM UTC+2, RjOllos wrote:
>
>
>
> On Thursday, May 4, 2017 at 5:06:53 AM UTC-7, toto200891 wrote:
>>
>> Yes I added, but user still cant view the ticket he created
>>
>
> To be sure, the plugin won't work for anonymous users. The users must be 
> authenticated. Is the user you have tested with authenticated?
>
> - Ryan 
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-04 Thread RjOllos


On Thursday, May 4, 2017 at 5:18:05 AM UTC-7, RjOllos wrote:
>
>
>
> On Thursday, May 4, 2017 at 5:06:53 AM UTC-7, toto200891 wrote:
>>
>> Yes I added, but user still cant view the ticket he created
>>
>
I installed the plugin in an environment and granted TICKET_CREATED and 
TICKET_VIEW_REPORTED to user3. With log level set to DEBUG, when trying to 
view a ticket for which user3 is not the reported, the following is seen in 
the output:

05:24:32 Trac[main] DEBUG: Dispatching 
05:24:32 Trac[main] DEBUG: Chosen handler is 
05:24:32 Trac[session] DEBUG: Retrieving session for ID u'user3'
05:24:32 Trac[main] DEBUG: Negotiated locale: None -> en_US
05:24:32 Trac[perm] DEBUG: SupportDeskPolicy denies user3 performing 
TICKET_VIEW on  


For a ticket reported by user3, there is no logging from SupportDeskPolicy 
and user3 can view the ticket:

05:26:19 Trac[main] DEBUG: Dispatching 
05:26:19 Trac[main] DEBUG: Chosen handler is 
05:26:19 Trac[session] DEBUG: Retrieving session for ID u'user3'
05:26:19 Trac[main] DEBUG: Negotiated locale: None -> en_US
05:26:19 Trac[perm] DEBUG: No policy allowed user3 performing TICKET_ADMIN 
on 
05:26:19 Trac[perm] DEBUG: No policy allowed user3 performing 
TICKET_EDIT_CC on 


Those are just the first few lines of output that follow the request. The 
total output is many lines, but there's no significant information in the 
lines that I haven't shown.

- Ryan

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-04 Thread RjOllos


On Thursday, May 4, 2017 at 5:06:53 AM UTC-7, toto200891 wrote:
>
> Yes I added, but user still cant view the ticket he created
>

To be sure, the plugin won't work for anonymous users. The users must be 
authenticated. Is the user you have tested with authenticated?

- Ryan 

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-04 Thread toto200891
Even the debug log file contains no errors, it says 

2017-05-04 14:12:22,812 Trac[loader] DEBUG: Loading file plugin 
SupportDeskPolicy from c:\tracprojects\project1\plugins\SupportDeskPolicy.py

Is there anything else am missing out?

Thankyou,

SF

On Thursday, May 4, 2017 at 2:06:53 PM UTC+2, toto200891 wrote:
>
> Yes I added, but user still cant view the ticket he created
>
>
> On Thursday, May 4, 2017 at 1:13:23 PM UTC+2, RjOllos wrote:
>>
>>
>>
>> On Thursday, May 4, 2017 at 4:00:20 AM UTC-7, toto200891 wrote:
>>>
>>> Great! the permission is displayed in the list, but If I grant the 
>>> permission to an user, and if he creates a ticket, he cannot view it? what 
>>> should i do for that? so that he can see the tickets he creates?
>>>
>>> Thank you,
>>>
>>> SF
>>>
>>
>> It seems the permission policy is not in effect, but the plugin is loaded 
>> correctly and enabled. Have you re-added SupportDeskPolicy to [trac] 
>> permission_policies?
>>
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-04 Thread toto200891
Yes I added, but user still cant view the ticket he created


On Thursday, May 4, 2017 at 1:13:23 PM UTC+2, RjOllos wrote:
>
>
>
> On Thursday, May 4, 2017 at 4:00:20 AM UTC-7, toto200891 wrote:
>>
>> Great! the permission is displayed in the list, but If I grant the 
>> permission to an user, and if he creates a ticket, he cannot view it? what 
>> should i do for that? so that he can see the tickets he creates?
>>
>> Thank you,
>>
>> SF
>>
>
> It seems the permission policy is not in effect, but the plugin is loaded 
> correctly and enabled. Have you re-added SupportDeskPolicy to [trac] 
> permission_policies?
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-04 Thread RjOllos


On Thursday, May 4, 2017 at 4:00:20 AM UTC-7, toto200891 wrote:
>
> Great! the permission is displayed in the list, but If I grant the 
> permission to an user, and if he creates a ticket, he cannot view it? what 
> should i do for that? so that he can see the tickets he creates?
>
> Thank you,
>
> SF
>

It seems the permission policy is not in effect, but the plugin is loaded 
correctly and enabled. Have you re-added SupportDeskPolicy to [trac] 
permission_policies?

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-04 Thread toto200891
I am using Trac 1.2.1

On Thursday, May 4, 2017 at 1:00:20 PM UTC+2, toto200891 wrote:
>
> Great! the permission is displayed in the list, but If I grant the 
> permission to an user, and if he creates a ticket, he cannot view it? what 
> should i do for that? so that he can see the tickets he creates?
>
> Thank you,
>
> SF
>
> On Thursday, May 4, 2017 at 12:45:45 PM UTC+2, RjOllos wrote:
>>
>>
>>
>> On Thursday, May 4, 2017 at 3:27:27 AM UTC-7, toto200891 wrote:
>>>
>>> ImportError: No module named support.supportdeskpolicy , it gave me this 
>>> error
>>>
>>> I dont understand what to write in that section in single plugin 
>>> approach setup file, Please guide me with this,
>>>
>>> Here is my setup.py I used
>>> from setuptools import find_packages, setup
>>>
>>> setup(
>>> name='SupportDeskPolicy', version='1.0',
>>> packages=find_packages(exclude=['*.tests*']),
>>> entry_points = {
>>> 'trac.plugins': [
>>> 'supportdeskpolicy = support.supportdeskpolicy',
>>> ],
>>> },
>>> )
>>>
>>
>> Simply copy the code (1) and paste it into a file in your environment 
>> plugins directory, with any name and extension .py, say 
>> SupportDeskPolicy.py.
>>
>> Per (2), you don't need to enable the plugin in your [components] section 
>> if you put it in the environment plugins directory.
>>
>> Restart your web server and the plugin should be enabled. If not, please 
>> check the logs and share what you find.
>>
>> Which version of Trac are you running?
>>
>> - Ryan
>>
>> (1) 
>> https://trac.edgewall.org/wiki/CookBook/PermissionPolicies#SupportDeskPolicy
>> (2) https://trac.edgewall.org/wiki/TracPlugins#Plugindiscovery
>>
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-04 Thread toto200891
Great! the permission is displayed in the list, but If I grant the 
permission to an user, and if he creates a ticket, he cannot view it? what 
should i do for that? so that he can see the tickets he creates?

Thank you,

SF

On Thursday, May 4, 2017 at 12:45:45 PM UTC+2, RjOllos wrote:
>
>
>
> On Thursday, May 4, 2017 at 3:27:27 AM UTC-7, toto200891 wrote:
>>
>> ImportError: No module named support.supportdeskpolicy , it gave me this 
>> error
>>
>> I dont understand what to write in that section in single plugin approach 
>> setup file, Please guide me with this,
>>
>> Here is my setup.py I used
>> from setuptools import find_packages, setup
>>
>> setup(
>> name='SupportDeskPolicy', version='1.0',
>> packages=find_packages(exclude=['*.tests*']),
>> entry_points = {
>> 'trac.plugins': [
>> 'supportdeskpolicy = support.supportdeskpolicy',
>> ],
>> },
>> )
>>
>
> Simply copy the code (1) and paste it into a file in your environment 
> plugins directory, with any name and extension .py, say 
> SupportDeskPolicy.py.
>
> Per (2), you don't need to enable the plugin in your [components] section 
> if you put it in the environment plugins directory.
>
> Restart your web server and the plugin should be enabled. If not, please 
> check the logs and share what you find.
>
> Which version of Trac are you running?
>
> - Ryan
>
> (1) 
> https://trac.edgewall.org/wiki/CookBook/PermissionPolicies#SupportDeskPolicy
> (2) https://trac.edgewall.org/wiki/TracPlugins#Plugindiscovery
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-04 Thread RjOllos


On Thursday, May 4, 2017 at 3:27:27 AM UTC-7, toto200891 wrote:
>
> ImportError: No module named support.supportdeskpolicy , it gave me this 
> error
>
> I dont understand what to write in that section in single plugin approach 
> setup file, Please guide me with this,
>
> Here is my setup.py I used
> from setuptools import find_packages, setup
>
> setup(
> name='SupportDeskPolicy', version='1.0',
> packages=find_packages(exclude=['*.tests*']),
> entry_points = {
> 'trac.plugins': [
> 'supportdeskpolicy = support.supportdeskpolicy',
> ],
> },
> )
>

Simply copy the code (1) and paste it into a file in your environment 
plugins directory, with any name and extension .py, say 
SupportDeskPolicy.py.

Per (2), you don't need to enable the plugin in your [components] section 
if you put it in the environment plugins directory.

Restart your web server and the plugin should be enabled. If not, please 
check the logs and share what you find.

Which version of Trac are you running?

- Ryan

(1) https://trac.edgewall.org/wiki/CookBook/PermissionPolicies#SupportDeskPolicy
(2) https://trac.edgewall.org/wiki/TracPlugins#Plugindiscovery

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-04 Thread toto200891
ImportError: No module named support.supportdeskpolicy , it gave me this 
error

I dont understand what to write in that section in single plugin approach 
setup file, Please guide me with this,

Here is my setup.py I used
from setuptools import find_packages, setup

setup(
name='SupportDeskPolicy', version='1.0',
packages=find_packages(exclude=['*.tests*']),
entry_points = {
'trac.plugins': [
'supportdeskpolicy = support.supportdeskpolicy',
],
},
)

On Thursday, May 4, 2017 at 12:16:53 PM UTC+2, RjOllos wrote:
>
>
>
> On Thu, May 4, 2017 at 3:15 AM toto200891  > wrote:
>
>> I followed single plugin approach, and I still no errors, yet I still 
>> cannot grant a permission TICKET_VIEW_REPORTED as it says it is an invalid 
>> action. What code would you like to see?
>>
>> SF
>>
>
> What does the log show with the single-file plugin approach?
>
> What are the permissions on the file you put in the $env/plugins directory?
>
> - Ryan 
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-04 Thread Ryan Ollos
On Thu, May 4, 2017 at 3:15 AM toto200891 
wrote:

> I followed single plugin approach, and I still no errors, yet I still
> cannot grant a permission TICKET_VIEW_REPORTED as it says it is an invalid
> action. What code would you like to see?
>
> SF
>

What does the log show with the single-file plugin approach?

What are the permissions on the file you put in the $env/plugins directory?

- Ryan

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-04 Thread toto200891
I followed single plugin approach, and I still no errors, yet I still 
cannot grant a permission TICKET_VIEW_REPORTED as it says it is an invalid 
action. What code would you like to see?

SF

On Thursday, May 4, 2017 at 11:52:27 AM UTC+2, RjOllos wrote:
>
>
>
> On Thu, May 4, 2017 at 2:44 AM toto200891  > wrote:
>
>> But I still don't see the permission TICKET_VIEW_REPORTED in the 
>> permission list
>>
>> Regards,
>> SF
>>
>
> It could be any number of things, I'd need to see your code and the 
> structure of your plugin source. Please try the single-file plugin approach.
>
> - Ryan
>
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-04 Thread Ryan Ollos
On Thu, May 4, 2017 at 2:44 AM toto200891 
wrote:

> But I still don't see the permission TICKET_VIEW_REPORTED in the
> permission list
>
> Regards,
> SF
>

It could be any number of things, I'd need to see your code and the
structure of your plugin source. Please try the single-file plugin approach.

- Ryan

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-04 Thread toto200891
But I still don't see the permission TICKET_VIEW_REPORTED in the permission 
list

Regards,
SF

On Thursday, May 4, 2017 at 11:43:34 AM UTC+2, toto200891 wrote:
>
> I ran DEBUG , and I see that the plugin is added, 
>
> 2017-05-04 11:38:28,457 Trac[loader] DEBUG: Adding plugin "support.py 
> 0.0.0" from "c:\tracprojects\project1\plugins\support.py-0.0.0-py2.7.egg"
>
> On Thursday, May 4, 2017 at 11:27:42 AM UTC+2, RjOllos wrote:
>>
>>
>>
>> On Thursday, May 4, 2017 at 1:57:22 AM UTC-7, toto200891 wrote:
>>>
>>> I reverted the ExtraPermissionProvider from my trac.ini configuration, 
>>> and also removed authzpolicy. But I still cannot give the permission 
>>> TICKET_VIEW_REPORTED permission to user, when I try to do that It says "it 
>>> is a non valid action" Here are my [trac] components
>>>
>>> [trac]
>>> permission_policies = SupportDeskPolicy
>>> permission_policies = 
>>> ReadonlyWikiPolicy,DefaultPermissionPolicy,LegacyAttachmentPolicy
>>> permission_store = DefaultPermissionStore
>>>
>>> I created an .egg file using the following setup file
>>>
>>> from setuptools import setup, find_packages
>>>  
>>> setup(
>>> name = "support.py",
>>> packages = find_packages()
>>> )
>>>
>>> And then I pasted the file in the env/plugin directory, But I am still 
>>> not able to define the permission to user, Please help me in this regard.
>>>
>>
>> You should check the logs to see if your plugin is loading:
>> https://trac.edgewall.org/wiki/TracTroubleshooting#ChecktheLogs
>>
>> If you lack experience with Python and plugin development, stick with the 
>> single-file plugin approach, it is much simpler and presents less 
>> opportunity for error. You can even share the single-file plugin among 
>> multiple environments:
>> https://trac.edgewall.org/wiki/TracIni#inherit-plugins_dir-option
>>
>> - Ryan 
>>
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-04 Thread toto200891
I ran DEBUG , and I see that the plugin is added, 

2017-05-04 11:38:28,457 Trac[loader] DEBUG: Adding plugin "support.py 
0.0.0" from "c:\tracprojects\project1\plugins\support.py-0.0.0-py2.7.egg"

On Thursday, May 4, 2017 at 11:27:42 AM UTC+2, RjOllos wrote:
>
>
>
> On Thursday, May 4, 2017 at 1:57:22 AM UTC-7, toto200891 wrote:
>>
>> I reverted the ExtraPermissionProvider from my trac.ini configuration, 
>> and also removed authzpolicy. But I still cannot give the permission 
>> TICKET_VIEW_REPORTED permission to user, when I try to do that It says "it 
>> is a non valid action" Here are my [trac] components
>>
>> [trac]
>> permission_policies = SupportDeskPolicy
>> permission_policies = 
>> ReadonlyWikiPolicy,DefaultPermissionPolicy,LegacyAttachmentPolicy
>> permission_store = DefaultPermissionStore
>>
>> I created an .egg file using the following setup file
>>
>> from setuptools import setup, find_packages
>>  
>> setup(
>> name = "support.py",
>> packages = find_packages()
>> )
>>
>> And then I pasted the file in the env/plugin directory, But I am still 
>> not able to define the permission to user, Please help me in this regard.
>>
>
> You should check the logs to see if your plugin is loading:
> https://trac.edgewall.org/wiki/TracTroubleshooting#ChecktheLogs
>
> If you lack experience with Python and plugin development, stick with the 
> single-file plugin approach, it is much simpler and presents less 
> opportunity for error. You can even share the single-file plugin among 
> multiple environments:
> https://trac.edgewall.org/wiki/TracIni#inherit-plugins_dir-option
>
> - Ryan 
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-04 Thread RjOllos


On Thursday, May 4, 2017 at 1:57:22 AM UTC-7, toto200891 wrote:
>
> I reverted the ExtraPermissionProvider from my trac.ini configuration, and 
> also removed authzpolicy. But I still cannot give the permission 
> TICKET_VIEW_REPORTED permission to user, when I try to do that It says "it 
> is a non valid action" Here are my [trac] components
>
> [trac]
> permission_policies = SupportDeskPolicy
> permission_policies = 
> ReadonlyWikiPolicy,DefaultPermissionPolicy,LegacyAttachmentPolicy
> permission_store = DefaultPermissionStore
>
> I created an .egg file using the following setup file
>
> from setuptools import setup, find_packages
>  
> setup(
> name = "support.py",
> packages = find_packages()
> )
>
> And then I pasted the file in the env/plugin directory, But I am still not 
> able to define the permission to user, Please help me in this regard.
>

You should check the logs to see if your plugin is loading:
https://trac.edgewall.org/wiki/TracTroubleshooting#ChecktheLogs

If you lack experience with Python and plugin development, stick with the 
single-file plugin approach, it is much simpler and presents less 
opportunity for error. You can even share the single-file plugin among 
multiple environments:
https://trac.edgewall.org/wiki/TracIni#inherit-plugins_dir-option

- Ryan 

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-04 Thread toto200891
I reverted the ExtraPermissionProvider from my trac.ini configuration, and 
also removed authzpolicy. But I still cannot give the permission 
TICKET_VIEW_REPORTED permission to user, when I try to do that It says "it 
is a non valid action" Here are my [trac] components

[trac]
permission_policies = SupportDeskPolicy
permission_policies = 
ReadonlyWikiPolicy,DefaultPermissionPolicy,LegacyAttachmentPolicy
permission_store = DefaultPermissionStore

I created an .egg file using the following setup file

from setuptools import setup, find_packages
 
setup(
name = "support.py",
packages = find_packages()
)

And then I pasted the file in the env/plugin directory, But I am still not 
able to define the permission to user, Please help me in this regard.

Thank you
SF
On Thursday, May 4, 2017 at 1:16:00 AM UTC+2, RjOllos wrote:
>
>
>
> On Wednesday, May 3, 2017 at 1:12:27 AM UTC-7, toto200891 wrote:
>>
>> To define a permission TICKET_VIEW_REPORTED, 
>>
>> [components]
>> tracopt.perm.config_perm_provider.extrapermissionsprovider = enabled
>>
>> [extra-permissions]
>> _perm = TICKET_VIEW_REPORTED
>>
>> and then the permission was given to the user.
>>
>
> You don't need to use ExtraPermissionProvider to define the permission. 
> The SupportDesk policy defines that. So you can revert that part of your 
> configuration.
>
> Regarding being unable to activate the plugin:
> You probably have an error in creating your egg, so how about just 
> starting with the single file plugin, as instructed on this page:
>
> https://trac.edgewall.org/wiki/CookBook/PermissionPolicies#SupportDeskPolicy
> I made a minor revision to update the steps on that page, so please review 
> them again.
>
> Regarding your inability to revoke TICKET_VIEW,
> Does your AuthzPolicy grant TICKET_VIEW?
>
> - Ryan
>
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-03 Thread RjOllos


On Wednesday, May 3, 2017 at 1:12:27 AM UTC-7, toto200891 wrote:
>
> To define a permission TICKET_VIEW_REPORTED, 
>
> [components]
> tracopt.perm.config_perm_provider.extrapermissionsprovider = enabled
>
> [extra-permissions]
> _perm = TICKET_VIEW_REPORTED
>
> and then the permission was given to the user.
>

You don't need to use ExtraPermissionProvider to define the permission. The 
SupportDesk policy defines that. So you can revert that part of your 
configuration.

Regarding being unable to activate the plugin:
You probably have an error in creating your egg, so how about just starting 
with the single file plugin, as instructed on this page:
https://trac.edgewall.org/wiki/CookBook/PermissionPolicies#SupportDeskPolicy
I made a minor revision to update the steps on that page, so please review 
them again.

Regarding your inability to revoke TICKET_VIEW,
Does your AuthzPolicy grant TICKET_VIEW?

- Ryan

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-03 Thread toto200891
To define a permission TICKET_VIEW_REPORTED, 

[components]
tracopt.perm.config_perm_provider.extrapermissionsprovider = enabled

[extra-permissions]
_perm = TICKET_VIEW_REPORTED

and then the permission was given to the user.

On Wednesday, May 3, 2017 at 10:07:44 AM UTC+2, toto200891 wrote:
>
> Yes, please see the components and permission_policies shown below:
>
> [trac]
>
> permission_policies = 
> AuthzPolicy,ReadonlyWikiPolicy,DefaultPermissionPolicy, 
> LegacyAttachmentPolicy
> permission_store = DefaultPermissionStore
>
> [components]
> supportdeskpolicy.* = enabled
>
>
>
>
> On Wednesday, May 3, 2017 at 7:10:14 AM UTC+2, RjOllos wrote:
>>
>>
>>
>> On Tuesday, May 2, 2017 at 1:34:07 PM UTC-7, toto200891 wrote:
>>>
>>> I tried adding as [trac] permission_policies = Supportdeskpolicy,... But 
>>> it produced this error 'component Ipermission policy must be enabled.
>>>
>>
>> Please let us know what you [trac] permission_policies was before making 
>> the edit.
>>
>> Please also share your [components] section.
>>
>> - Ryan 
>>
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-03 Thread toto200891
Yes, please see the components and permission_policies shown below:

[trac]

permission_policies = 
AuthzPolicy,ReadonlyWikiPolicy,DefaultPermissionPolicy, 
LegacyAttachmentPolicy
permission_store = DefaultPermissionStore

[components]
supportdeskpolicy.* = enabled




On Wednesday, May 3, 2017 at 7:10:14 AM UTC+2, RjOllos wrote:
>
>
>
> On Tuesday, May 2, 2017 at 1:34:07 PM UTC-7, toto200891 wrote:
>>
>> I tried adding as [trac] permission_policies = Supportdeskpolicy,... But 
>> it produced this error 'component Ipermission policy must be enabled.
>>
>
> Please let us know what you [trac] permission_policies was before making 
> the edit.
>
> Please also share your [components] section.
>
> - Ryan 
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-02 Thread RjOllos


On Tuesday, May 2, 2017 at 1:34:07 PM UTC-7, toto200891 wrote:
>
> I tried adding as [trac] permission_policies = Supportdeskpolicy,... But 
> it produced this error 'component Ipermission policy must be enabled.
>

Please let us know what you [trac] permission_policies was before making 
the edit.

Please also share your [components] section.

- Ryan 

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-02 Thread toto200891
I tried adding as [trac] permission_policies = Supportdeskpolicy,... But it 
produced this error 'component Ipermission policy must be enabled.


On Tuesday, May 2, 2017 at 7:48:18 PM UTC+2, RjOllos wrote:
>
>
>
> On Tue, May 2, 2017 at 7:28 AM toto200891  > wrote:
>
>> I have also granted permissions like TICKET_APPEND, TICKET_CHGPROP, and 
>> TICKET_MODIFY, as mentioned in the following recipe 
>> https://trac.edgewall.org/wiki/CookBook/PermissionPolicies#SupportDeskPolicy
>>
>> Regards,
>> SF
>>
>
> What is your [trac] permission_policies setting?
>
> - Ryan 
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-02 Thread Ryan Ollos
On Tue, May 2, 2017 at 7:28 AM toto200891 
wrote:

> I have also granted permissions like TICKET_APPEND, TICKET_CHGPROP, and
> TICKET_MODIFY, as mentioned in the following recipe
> https://trac.edgewall.org/wiki/CookBook/PermissionPolicies#SupportDeskPolicy
>
> Regards,
> SF
>

What is your [trac] permission_policies setting?

- Ryan

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-02 Thread Ryan Ollos
On Tue, May 2, 2017 at 6:59 AM Steffen Hoffmann  wrote:

> Am 2. Mai 2017 14:06:31 MESZ schrieb toto200891 <
> syedfarathsay...@gmail.com>:
> >Hello,
> >
> >I have a question related to custom policies. I am trying to define a
> >permission that allows a user to view the tickets only reported by him.
> >I
> >followed the steps in
> >
> https://trac.edgewall.org/wiki/CookBook/PermissionPolicies#SupportDeskPolicy
> >
> >and created a egg file using setuptools and copied the egg file in
> >plugin
> >directory
> >
> >and also granted the permission TICKET_VIEW_REPORTED
> >
> >But I still see that the user can see the tickets created by other
> >users
> >and also modify it, though the permission like TICKET_VIEW is been
> >revoked
> >from that user.
>
> Are you sure, the user in question owns no other TICKET_* permission, that
> inherits TICKET_VIEW? Even if you checked this yourself, I would rather
> double-check that before looking at your custom permission policy
> implementation.
>
> Greetings,
>
> Steffen Hoffmann
>

Hello Steffen!

Good to hear from you, and welcome back to the mailing list. I hope you are
doing well.

- Ryan

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-02 Thread toto200891
I have also granted permissions like TICKET_APPEND, TICKET_CHGPROP, and 
TICKET_MODIFY, as mentioned in the following recipe 
https://trac.edgewall.org/wiki/CookBook/PermissionPolicies#SupportDeskPolicy

Regards,
SF

On Tuesday, May 2, 2017 at 3:59:28 PM UTC+2, hasienda wrote:
>
> Am 2. Mai 2017 14:06:31 MESZ schrieb toto200891  >: 
> >Hello, 
> > 
> >I have a question related to custom policies. I am trying to define a 
> >permission that allows a user to view the tickets only reported by him. 
> >I 
> >followed the steps in 
> >
> https://trac.edgewall.org/wiki/CookBook/PermissionPolicies#SupportDeskPolicy 
> > 
> >and created a egg file using setuptools and copied the egg file in 
> >plugin 
> >directory 
> > 
> >and also granted the permission TICKET_VIEW_REPORTED 
> > 
> >But I still see that the user can see the tickets created by other 
> >users 
> >and also modify it, though the permission like TICKET_VIEW is been 
> >revoked 
> >from that user. 
>
> Are you sure, the user in question owns no other TICKET_* permission, that 
> inherits TICKET_VIEW? Even if you checked this yourself, I would rather 
> double-check that before looking at your custom permission policy 
> implementation. 
>
> Greetings, 
>
> Steffen Hoffmann 
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Custom policies

2017-05-02 Thread Steffen Hoffmann
Am 2. Mai 2017 14:06:31 MESZ schrieb toto200891 :
>Hello,
>
>I have a question related to custom policies. I am trying to define a 
>permission that allows a user to view the tickets only reported by him.
>I 
>followed the steps in 
>https://trac.edgewall.org/wiki/CookBook/PermissionPolicies#SupportDeskPolicy
>
>and created a egg file using setuptools and copied the egg file in
>plugin 
>directory
>
>and also granted the permission TICKET_VIEW_REPORTED 
>
>But I still see that the user can see the tickets created by other
>users 
>and also modify it, though the permission like TICKET_VIEW is been
>revoked 
>from that user.

Are you sure, the user in question owns no other TICKET_* permission, that 
inherits TICKET_VIEW? Even if you checked this yourself, I would rather 
double-check that before looking at your custom permission policy 
implementation.

Greetings,

Steffen Hoffmann

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


[Trac] Custom policies

2017-05-02 Thread toto200891
Hello,

I have a question related to custom policies. I am trying to define a 
permission that allows a user to view the tickets only reported by him. I 
followed the steps in 
https://trac.edgewall.org/wiki/CookBook/PermissionPolicies#SupportDeskPolicy 
and created a egg file using setuptools and copied the egg file in plugin 
directory

and also granted the permission TICKET_VIEW_REPORTED 

But I still see that the user can see the tickets created by other users 
and also modify it, though the permission like TICKET_VIEW is been revoked 
from that user.

Is there anything am missing out? any help is appreciated.

Regards,
SF

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.