myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [3535] trunk/lib/authorization.rb: restricted gro


From: noreply
Subject: [myexperiment-hackers] [3535] trunk/lib/authorization.rb: restricted group top level comments to members
Date: Wed, 8 May 2013 16:03:44 +0000 (UTC)

Revision
3535
Author
dgc
Date
2013-05-08 16:03:44 +0000 (Wed, 08 May 2013)

Log Message

restricted group top level comments to members

Modified Paths

Diff

Modified: trunk/lib/authorization.rb (3534 => 3535)


--- trunk/lib/authorization.rb	2013-05-08 14:09:55 UTC (rev 3534)
+++ trunk/lib/authorization.rb	2013-05-08 16:03:44 UTC (rev 3535)
@@ -107,6 +107,12 @@
         case action
           when "create"
 
+            # You can only comment on a Group if you are a member
+            if context.kind_of?(Network)
+              return false if user.nil?
+              return false unless context.member?(user.id)
+            end
+
             # Comments can be created by authenticated users that can view the context
             return !user.nil? && Authorization.check('view', context, user)
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]