This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Class | |
def with_attr_reader(*args, &b) | |
with_attr(:attr_reader, *args, &b) | |
end | |
def with_attr_writer(*args, &b) | |
with_attr(:attr_writer, *args, &b) | |
end | |
def with_attr_accessor(*args, &b) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User < Model | |
include CouchObject::Persistable | |
include Securable | |
with_attr_reader :username do | |
min_read_permission :guest | |
end | |
with_attr_reader :email, :password do | |
min_read_permission :owner |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Test{ | |
[Serializable] | |
[Securable] | |
[ThisPropertyIsAwesome] | |
public string Name{get; set;} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Securable | |
def self.included(base) | |
base.extend(ClassMethods) | |
end | |
class Secured | |
def initialize(p, o) | |
@o = o | |
@o.class.methods_with_permissions(p) {|m| define_proxy_method(m)} | |
end | |
NewerOlder