RS IZ friend requests are hopefully now signed
This commit is contained in:
parent
7676179e54
commit
6832c67a78
1 changed files with 20 additions and 0 deletions
|
|
@ -3,6 +3,7 @@ class Request
|
|||
include MongoMapper::Document
|
||||
include Diaspora::Webhooks
|
||||
include ROXML
|
||||
include Encryptable
|
||||
|
||||
xml_accessor :_id
|
||||
xml_accessor :person, :as => Person
|
||||
|
|
@ -38,7 +39,26 @@ class Request
|
|||
p.save
|
||||
end
|
||||
|
||||
#ENCRYPTION
|
||||
before_validation :sign_if_mine
|
||||
validates_true_for :creator_signature, :logic => lambda {self.verify_creator_signature}
|
||||
|
||||
xml_accessor :creator_signature
|
||||
key :creator_signature, String
|
||||
|
||||
def signable_accessors
|
||||
accessors = self.class.roxml_attrs.collect{|definition|
|
||||
definition.accessor}
|
||||
accessors.delete 'person'
|
||||
accessors.delete 'creator_signature'
|
||||
accessors
|
||||
end
|
||||
|
||||
def signable_string
|
||||
signable_accessors.collect{|accessor|
|
||||
(self.send accessor.to_sym).to_s}.join ';'
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def clean_link
|
||||
|
|
|
|||
Loading…
Reference in a new issue