Files
fetsite/app/doc/Ability.html
Andreas Stephanides 0216dbdaae Dokumentation hinzugefügt
annotation gem installiert und Dokumentation in app/doc eingefügt
2013-07-23 13:50:03 +02:00

284 lines
9.1 KiB
HTML
Raw Blame History

<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title>class Ability - RDoc Documentation</title>
<link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
<script type="text/javascript">
var rdoc_rel_prefix = "./";
</script>
<script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
<body id="top" class="class">
<nav id="metadata">
<nav id="home-section" class="section">
<h3 class="section-header">
<a href="./index.html">Home</a>
<a href="./table_of_contents.html#classes">Classes</a>
<a href="./table_of_contents.html#methods">Methods</a>
</h3>
</nav>
<nav id="search-section" class="section project-section" class="initially-hidden">
<form action="#" method="get" accept-charset="utf-8">
<h3 class="section-header">
<input type="text" name="search" placeholder="Search" id="search-field"
title="Type to search, Up and Down to navigate, Enter to load">
</h3>
</form>
<ul id="search-results" class="initially-hidden"></ul>
</nav>
<div id="file-metadata">
<nav id="file-list-section" class="section">
<h3 class="section-header">Defined In</h3>
<ul>
<li>models/ability.rb
</ul>
</nav>
</div>
<div id="class-metadata">
<nav id="parent-class-section" class="section">
<h3 class="section-header">Parent</h3>
<p class="link">Object
</nav>
<!-- Included Modules -->
<nav id="includes-section" class="section">
<h3 class="section-header">Included Modules</h3>
<ul class="link-list">
<li><span class="include">CanCan::Ability</span>
</ul>
</nav>
<!-- Method Quickref -->
<nav id="method-list-section" class="section">
<h3 class="section-header">Methods</h3>
<ul class="link-list">
<li><a href="#method-c-new">::new</a>
</ul>
</nav>
</div>
<div id="project-metadata">
<nav id="classindex-section" class="section project-section">
<h3 class="section-header">Class and Module Index</h3>
<ul class="link-list">
<li><a href="./Ability.html">Ability</a>
<li><a href="./ApplicationController.html">ApplicationController</a>
<li><a href="./ApplicationHelper.html">ApplicationHelper</a>
<li><a href="./Beispiel.html">Beispiel</a>
<li><a href="./BeispieleController.html">BeispieleController</a>
<li><a href="./BeispieleHelper.html">BeispieleHelper</a>
<li><a href="./ConfigController.html">ConfigController</a>
<li><a href="./Confirmmailer.html">Confirmmailer</a>
<li><a href="./HomeController.html">HomeController</a>
<li><a href="./Lva.html">Lva</a>
<li><a href="./LvasController.html">LvasController</a>
<li><a href="./Modul.html">Modul</a>
<li><a href="./Modulgruppe.html">Modulgruppe</a>
<li><a href="./ModulgruppenController.html">ModulgruppenController</a>
<li><a href="./ModulgruppenHelper.html">ModulgruppenHelper</a>
<li><a href="./ModulsController.html">ModulsController</a>
<li><a href="./ModulsHelper.html">ModulsHelper</a>
<li><a href="./Neuigkeit.html">Neuigkeit</a>
<li><a href="./NeuigkeitenController.html">NeuigkeitenController</a>
<li><a href="./PagesHelper.html">PagesHelper</a>
<li><a href="./Role.html">Role</a>
<li><a href="./Rubrik.html">Rubrik</a>
<li><a href="./RubrikenController.html">RubrikenController</a>
<li><a href="./RubrikenHelper.html">RubrikenHelper</a>
<li><a href="./Semester.html">Semester</a>
<li><a href="./SemestersController.html">SemestersController</a>
<li><a href="./SemestersHelper.html">SemestersHelper</a>
<li><a href="./StudienController.html">StudienController</a>
<li><a href="./StudienHelper.html">StudienHelper</a>
<li><a href="./Studium.html">Studium</a>
<li><a href="./StudmodsHelper.html">StudmodsHelper</a>
<li><a href="./TinymceTextInput.html">TinymceTextInput</a>
<li><a href="./User.html">User</a>
<li><a href="./UsersController.html">UsersController</a>
</ul>
</nav>
</div>
</nav>
<div id="documentation">
<h1 class="class">class Ability</h1>
<div id="description" class="description">
</div><!-- description -->
<section id="5Buntitled-5D" class="documentation-section">
<!-- Methods -->
<section id="public-class-5Buntitled-5D-method-details" class="method-section section">
<h3 class="section-header">Public Class Methods</h3>
<div id="method-c-new" class="method-detail ">
<div class="method-heading">
<span class="method-name">new</span><span
class="method-args">(user)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code" id="new-source">
<pre><span class="ruby-comment"># File models/ability.rb, line 3</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">user</span>)
<span class="ruby-comment"># Define abilities for the passed in user here. For example:</span>
<span class="ruby-comment">#</span>
<span class="ruby-comment"># if user.admin?</span>
<span class="ruby-comment"># can :manage, :all</span>
<span class="ruby-comment"># else</span>
<span class="ruby-comment"># can :read, :all</span>
<span class="ruby-comment"># end</span>
<span class="ruby-comment"># The first argument to `can` is the action you are giving the user permission to do.</span>
<span class="ruby-comment"># If you pass :manage it will apply to every action. Other common actions here are</span>
<span class="ruby-comment"># :read, :create, :update and :destroy.</span>
<span class="ruby-comment">#</span>
<span class="ruby-comment"># The second argument is the resource the user can perform the action on. If you pass</span>
<span class="ruby-comment"># :all it will apply to every resource. Otherwise pass a Ruby class of the resource.</span>
<span class="ruby-comment">#</span>
<span class="ruby-comment"># The third argument is an optional hash of conditions to further filter the objects.</span>
<span class="ruby-comment"># For example, here the user can only update published articles.</span>
<span class="ruby-comment">#</span>
<span class="ruby-comment"># can :update, Article, :published =&gt; true</span>
<span class="ruby-comment">#</span>
<span class="ruby-comment"># See the wiki for details: https://github.com/ryanb/cancan/wiki/Defining-Abilitiescan :manage, :all</span>
<span class="ruby-identifier">user</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">User</span>.<span class="ruby-identifier">new</span> <span class="ruby-comment"># guest user (not logged in)</span>
<span class="ruby-comment"># For Debug allow everything</span>
<span class="ruby-comment"># Remove this line in production environment and for testing user management</span>
<span class="ruby-identifier">can</span> <span class="ruby-value">:manage</span>, <span class="ruby-value">:all</span>
<span class="ruby-comment"># Rechteverwaltung f<>r Studien Modul</span>
<span class="ruby-identifier">can</span> <span class="ruby-value">:read</span>, <span class="ruby-constant">Modulgruppe</span>
<span class="ruby-identifier">can</span> <span class="ruby-value">:manage</span>, <span class="ruby-constant">Modulgruppe</span>
<span class="ruby-comment"># Rechteverwaltung fuer Neuigkeiten</span>
<span class="ruby-comment"># can :write, Neuigkeit if user.has_role?(&quot;newsmoderator&quot;, Neuigkeit.rubrik)</span>
<span class="ruby-keyword">if</span> <span class="ruby-identifier">user</span>.<span class="ruby-identifier">has_role?</span> <span class="ruby-string">&quot;newsadmin&quot;</span>
<span class="ruby-identifier">can</span> <span class="ruby-value">:addmoderator</span>, <span class="ruby-constant">Rubrik</span>
<span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
</div><!-- new-source -->
</div>
</div><!-- new-method -->
</section><!-- public-class-method-details -->
</section><!-- 5Buntitled-5D -->
</div><!-- documentation -->
<footer id="validator-badges">
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.1.
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
</footer>