myexperiment-hackers
[Top][All Lists]
Advanced

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

[myexperiment-hackers] [2096] trunk: removal of more old authorisation c


From: noreply
Subject: [myexperiment-hackers] [2096] trunk: removal of more old authorisation code
Date: Thu, 12 Feb 2009 16:27:36 -0500 (EST)

Revision
2096
Author
dgc
Date
2009-02-12 16:27:36 -0500 (Thu, 12 Feb 2009)

Log Message

removal of more old authorisation code

Modified Paths

Diff

Modified: trunk/app/models/network.rb (2095 => 2096)


--- trunk/app/models/network.rb	2009-02-10 13:25:08 UTC (rev 2095)
+++ trunk/app/models/network.rb	2009-02-12 21:27:36 UTC (rev 2096)
@@ -38,17 +38,6 @@
     self.find_by_sql("SELECT n.* FROM networks n JOIN permissions perm ON n.id = perm.contributor_id AND perm.contributor_type = 'Network' JOIN policies p ON perm.policy_id = p.id JOIN contributions c ON p.id = c.policy_id GROUP BY perm.contributor_id ORDER BY COUNT(perm.contributor_id) DESC, n.title LIMIT #{limit}")
   end
   
-  # protected? asks the question "is other protected by me?"
-  def protected?(other)
-    if other.kind_of? User        # if other is a User...
-      return member?(other.id)    #       ...is other a member of me?
-    elsif other.kind_of? Network  # if other is a Network...
-      return relation?(other.id)  #       ...is other a child of mine?
-    else                          # otherwise...
-      return false                #       ...no
-    end
-  end
-  
   validates_associated :owner
   
   validates_presence_of :user_id, :title

Modified: trunk/app/models/policy.rb (2095 => 2096)


--- trunk/app/models/policy.rb	2009-02-10 13:25:08 UTC (rev 2095)
+++ trunk/app/models/policy.rb	2009-02-12 21:27:36 UTC (rev 2096)
@@ -57,9 +57,7 @@
   
 private
 
-  # categorize action names here (make sure you include each one as an 
-  # xxx_public and xxx_protected column in ++policies++ and an xxx 
-  # column in ++permissions+)
+  # categorize action names here 
   @@categories = { "download" => ["download", 
                                   "named_download", 
                                   "submit_job",
@@ -108,14 +106,6 @@
     return nil
   end
   
-  def public?(category)
-    attributes["#{category}_public"] == true
-  end
-  
-  def protected?(category)
-    attributes["#{category}_protected"] == true
-  end
-  
   def all_permissions_for_contributor(contrib)
     # call recursive method
     found = []

Modified: trunk/app/models/user.rb (2095 => 2096)


--- trunk/app/models/user.rb	2009-02-10 13:25:08 UTC (rev 2095)
+++ trunk/app/models/user.rb	2009-02-12 21:27:36 UTC (rev 2096)
@@ -283,17 +283,6 @@
 
   acts_as_solr(:fields => [ :name, :tag_list ], :include => [ :profile ]) if SOLR_ENABLE
 
-  # protected? asks the question "is other protected by me?"
-  def protected?(other)
-    if other.kind_of? User               # if other is a User...
-      return friend?(other.id)   #       ...is other a friend of mine?
-    elsif other.kind_of? Network         # if other is a Network...
-      return other.member?(id)           #       ...am I a member of other?
-    else                                 # otherwise...
-      return false                       #       ...no
-    end
-  end
-  
   validates_presence_of :name
   
   has_one :profile,

Modified: trunk/lib/acts_as_contributor.rb (2095 => 2096)


--- trunk/lib/acts_as_contributor.rb	2009-02-10 13:25:08 UTC (rev 2095)
+++ trunk/lib/acts_as_contributor.rb	2009-02-12 21:27:36 UTC (rev 2096)
@@ -63,12 +63,6 @@
 
           return rtn
         end
-
-        # this method is called by the Policy instance when authorizing protected attributes.
-        def protected?(other)
-          # extend in instance class
-          false
-        end
         
         def contribution_tags
           tags = contribution_tags!

reply via email to

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